{"record":{"id":"5e09200ac015bd69","repo":"tensorflow/models","slug":"got-unsupported-tensor-type-for-feature-feature-n","errorCode":null,"errorMessage":"Got unsupported tensor type for feature {feature_name}. The feature tensor must be one of `tf.Tensor`, `tf.SparseTensor` or `tf.RaggedTensor`, but got {feature} instead.","messagePattern":"Got unsupported tensor type for feature (.+?)\\. The feature tensor must be one of `tf\\.Tensor`, `tf\\.SparseTensor` or `tf\\.RaggedTensor`, but got (.+?) instead\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"official/recommendation/uplift/layers/encoders/concat_features.py","lineNumber":102,"sourceCode":"            \" same shape except for the last dimension, but got features with\"\n            f\" incompatible shapes {feature_shapes}\"\n        )\n\n    super().build(input_shapes)\n\n  def call(self, inputs: types.DictOfTensors) -> tf.Tensor:\n    features = []\n\n    for feature_name, feature in inputs.items():\n      if feature_name in self._feature_names:\n        if isinstance(feature, tf.Tensor):\n          features.append(feature)\n        elif isinstance(feature, tf.SparseTensor):\n          features.append(tf.sparse.to_dense(feature))\n        elif isinstance(feature, tf.RaggedTensor):\n          features.append(feature.to_tensor())\n        else:\n          raise TypeError(\n              f\"Got unsupported tensor type for feature {feature_name}. The\"\n              \" feature tensor must be one of `tf.Tensor`, `tf.SparseTensor` or\"\n              f\" `tf.RaggedTensor`, but got {feature} instead.\"\n          )\n\n    return tf.concat(features, axis=-1)\n\n  def get_config(self):\n    config = super().get_config()\n    config.update({\"feature_names\": self._feature_names})\n    return config\n","sourceCodeStart":84,"sourceCodeEnd":114,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/recommendation/uplift/layers/encoders/concat_features.py#L84-L114","documentation":"Error \"Got unsupported tensor type for feature {feature_name}. The feature tensor must be one of `tf.Tensor`, `tf.SparseTensor` or `tf.RaggedTensor`, but got {feature} instead.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/recommendation/uplift/layers/encoders/concat_features.py:102 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"}