{"record":{"id":"0f167e222204911e","repo":"keras-team/keras","slug":"the-row-splits-dtype-attribute-of-kerastensor-is","errorCode":null,"errorMessage":"The `row_splits_dtype` attribute of KerasTensor is immutable. One should create a new instance of KerasTensor for this.","messagePattern":"The `row_splits_dtype` attribute of KerasTensor is immutable\\. One should create a new instance of KerasTensor for this\\.","errorType":"exception","errorClass":"AttributeError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/common/keras_tensor.py","lineNumber":119,"sourceCode":"\n    @property\n    def ragged_rank(self):\n        return self._ragged_rank\n\n    @ragged_rank.setter\n    def ragged_rank(self, value):\n        raise AttributeError(\n            \"The `ragged_rank` attribute of KerasTensor is immutable. One \"\n            \"should create a new instance of KerasTensor for this.\"\n        )\n\n    @property\n    def row_splits_dtype(self):\n        return self._row_splits_dtype\n\n    @row_splits_dtype.setter\n    def row_splits_dtype(self, value):\n        raise AttributeError(\n            \"The `row_splits_dtype` attribute of KerasTensor is immutable. One \"\n            \"should create a new instance of KerasTensor for this.\"\n        )\n\n    @property\n    def ragged(self):\n        return self._ragged\n\n    @ragged.setter\n    def ragged(self, value):\n        raise AttributeError(\n            \"The `ragged` attribute of KerasTensor is immutable. One should \"\n            \"create a new instance of KerasTensor for this.\"\n        )\n\n    @property\n    def ndim(self):\n        return len(self.shape)","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/common/keras_tensor.py#L101-L137","documentation":"Raised by the row_splits_dtype property setter of KerasTensor when code assigns to .row_splits_dtype. This dtype of a ragged tensor's row splits is part of the tensor's immutable symbolic specification, so the setter unconditionally rejects assignment.","triggerScenarios":"Thrown at keras/src/backend/common/keras_tensor.py:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create a fresh KerasTensor with the desired row_splits_dtype","Regenerate the tensor via an op/layer that produces the correct row-splits dtype"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}