{"record":{"id":"ba2758ca1f5cb817","repo":"tensorflow/models","slug":"got-unsupported-tensor-shape-type-for-feature-fea","errorCode":null,"errorMessage":"Got unsupported tensor shape type for feature {feature_name}. The feature tensor must be one of `tf.Tensor`, `tf.SparseTensor` or `tf.RaggedTensor`, with a well defined tensor shape but got shape {shape} instead.","messagePattern":"Got unsupported tensor shape type for feature (.+?)\\. The feature tensor must be one of `tf\\.Tensor`, `tf\\.SparseTensor` or `tf\\.RaggedTensor`, with a well defined tensor shape but got shape (.+?) instead\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"official/recommendation/uplift/layers/encoders/concat_features.py","lineNumber":70,"sourceCode":"          \"feature_names must be a list of strings, but got types\"\n          f\" {list(map(type, feature_names))}\"\n      )\n\n  def build(self, input_shapes: Mapping[str, tf.TensorShape]) -> None:\n    missing_features = set(self._feature_names) - input_shapes.keys()\n    if missing_features:\n      raise ValueError(f\"Layer inputs is missing features: {missing_features}\")\n\n    feature_shapes = {\n        feature_name: tensor_shape\n        for feature_name, tensor_shape in input_shapes.items()\n        if feature_name in self._feature_names\n    }\n\n    most_specific_shape = tf.TensorShape(None)\n    for feature_name, shape in feature_shapes.items():\n      if not isinstance(shape, tf.TensorShape):\n        raise TypeError(\n            f\"Got unsupported tensor shape type for feature {feature_name}. The\"\n            \" feature tensor must be one of `tf.Tensor`, `tf.SparseTensor` or\"\n            \" `tf.RaggedTensor`, with a well defined tensor shape but got shape\"\n            f\" {shape} instead.\"\n        )\n\n      shape = shape[:-1]\n      if shape.is_subtype_of(most_specific_shape):\n        most_specific_shape = shape\n\n      elif not most_specific_shape.is_subtype_of(shape):\n        raise ValueError(\n            \"All features from the feature_names set must be tensors with the\"\n            \" same shape except for the last dimension, but got features with\"\n            f\" incompatible shapes {feature_shapes}\"\n        )\n\n    super().build(input_shapes)","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/recommendation/uplift/layers/encoders/concat_features.py#L52-L88","documentation":"Error \"Got unsupported tensor shape type for feature {feature_name}. The feature tensor must be one of `tf.Tensor`, `tf.SparseTensor` or `tf.RaggedTensor`, with a well defined tensor shape but got shape {shape} instead.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/recommendation/uplift/layers/encoders/concat_features.py:70 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}