{
  "id": "tensorflow/ragged-tensor-unsupported-op",
  "signature": "InvalidArgumentError: Ragged tensor is not supported for this operation. [Op:RaggedTensorToSparse]",
  "signature_zh": "InvalidArgumentError: 此操作不支持不规则张量。 [Op:RaggedTensorToSparse]",
  "regex": "InvalidArgumentError.*Ragged tensor is not supported for this operation",
  "domain": "tensorflow",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "An operation that requires dense tensors was applied to a ragged tensor, which must be converted to a sparse or dense representation first.",
  "root_cause_type": "generic",
  "root_cause_zh": "对不规则张量应用了需要稠密张量的操作，必须先将不规则张量转换为稀疏或稠密表示。",
  "versions": [
    {
      "version": "tensorflow==2.15.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "tensorflow==2.16.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Using tf.sparse.to_dense on a ragged tensor directly fails because ragged tensors are not sparse.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Padding the ragged tensor manually with ragged_tensor.to_tensor() may cause memory blowup for large sequences.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Convert the ragged tensor to a dense tensor with explicit padding before the unsupported operation.",
      "success_rate": 0.9,
      "how": "Convert the ragged tensor to a dense tensor with explicit padding before the unsupported operation.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use tf.RaggedTensor.from_tensor to create a ragged tensor and then apply row splitting for compatible ops.",
      "success_rate": 0.85,
      "how": "Use tf.RaggedTensor.from_tensor to create a ragged tensor and then apply row splitting for compatible ops.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Convert the ragged tensor to a dense tensor with explicit padding before the unsupported operation.",
    "Use tf.RaggedTensor.from_tensor to create a ragged tensor and then apply row splitting for compatible ops."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.tensorflow.org/guide/ragged_tensor",
  "official_doc_section": null,
  "error_code": "RAGGED_UNSUPPORTED",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-01-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}