{"record":{"id":"1acfb510805640a9","repo":"keras-team/keras","slug":"a-kerastensor-is-symbolic-it-s-a-placeholder-for-1acfb5","errorCode":null,"errorMessage":"A KerasTensor is symbolic: it's a placeholder for a shape an a dtype. It doesn't have any actual numerical value. You cannot convert it to a float.","messagePattern":"A KerasTensor is symbolic: it's a placeholder for a shape an a dtype\\. It doesn't have any actual numerical value\\. You cannot convert it to a float\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/common/keras_tensor.py","lineNumber":157,"sourceCode":"    def reshape(self, newshape):\n        from keras.src import ops\n\n        return ops.Reshape(newshape)(self)\n\n    def squeeze(self, axis=None):\n        from keras.src import ops\n\n        return ops.Squeeze(axis)(self)\n\n    def __int__(self):\n        raise ValueError(\n            \"A KerasTensor is symbolic: it's a placeholder for a shape \"\n            \"an a dtype. It doesn't have any actual numerical value. \"\n            \"You cannot convert it to an int.\"\n        )\n\n    def __float__(self):\n        raise ValueError(\n            \"A KerasTensor is symbolic: it's a placeholder for a shape \"\n            \"an a dtype. It doesn't have any actual numerical value. \"\n            \"You cannot convert it to a float.\"\n        )\n\n    def __array__(self):\n        raise ValueError(\n            \"A KerasTensor is symbolic: it's a placeholder for a shape \"\n            \"an a dtype. It doesn't have any actual numerical value. \"\n            \"You cannot convert it to a NumPy array.\"\n        )\n\n    def __jax_array__(self):\n        raise ValueError(\n            \"A KerasTensor cannot be used as input to a JAX function. \"\n            \"A KerasTensor is a symbolic placeholder for a shape and dtype, \"\n            \"used when constructing Keras Functional models \"\n            \"or Keras Functions. You can only use it as input to a Keras layer \"","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/common/keras_tensor.py#L139-L175","documentation":"Error \"A KerasTensor is symbolic: it's a placeholder for a shape an a dtype. It doesn't have any actual numerical value. You cannot convert it to a float.\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/common/keras_tensor.py:157 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":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","schemaVersion":2},"datasetVersion":"2026-08-26T02:17:13.382Z"}