{"record":{"id":"433fada3dcd871f9","repo":"keras-team/keras","slug":"a-kerastensor-is-symbolic-it-s-a-placeholder-for-433fad","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 NumPy array.","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 NumPy array\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/common/keras_tensor.py","lineNumber":164,"sourceCode":"\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 \"\n            \"or a Keras operation (from the namespaces `keras.layers` \"\n            \"and `keras.ops`). \"\n            \"You are likely doing something like:\\n\\n\"\n            \"```\\n\"\n            \"x = Input(...)\\n\"\n            \"...\\n\"\n            \"jax_fn(x)  # Invalid.\\n\"","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/common/keras_tensor.py#L146-L182","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 NumPy array.\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/common/keras_tensor.py:164 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"}