{"record":{"id":"2b4450474d22d789","repo":"keras-team/keras","slug":"axis-axis-is-out-of-bounds-for-input-shape-inpu-2b4450","errorCode":null,"errorMessage":"Axis {axis} is out of bounds for input shape {input_shape}. Received: axis={self.axis}","messagePattern":"Axis (.+?) is out of bounds for input shape (.+?)\\. Received: axis=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/layers/normalization/rms_normalization.py","lineNumber":86,"sourceCode":"            x: Input tensor of shape (batch_size, input_dim).\n\n        Returns:\n            The RMS-normalized tensor of the same shape (batch_size, input_dim),\n            scaled by the learned `scale` parameter.\n        \"\"\"\n        return ops.rms_normalization(\n            x, scale=self.scale, axis=self.axis, epsilon=self.epsilon\n        )\n\n    def compute_output_shape(self, input_shape):\n        if isinstance(self.axis, int):\n            axes = [self.axis]\n        else:\n            axes = self.axis\n\n        for axis in axes:\n            if axis >= len(input_shape) or axis < -len(input_shape):\n                raise ValueError(\n                    f\"Axis {axis} is out of bounds for \"\n                    f\"input shape {input_shape}. \"\n                    f\"Received: axis={self.axis}\"\n                )\n        return input_shape\n\n    def get_config(self):\n        config = {\n            \"axis\": self.axis,\n            \"epsilon\": self.epsilon,\n        }\n        base_config = super().get_config()\n        return {**base_config, **config}\n","sourceCodeStart":68,"sourceCodeEnd":100,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/layers/normalization/rms_normalization.py#L68-L100","documentation":"Error \"Axis {axis} is out of bounds for input shape {input_shape}. Received: axis={self.axis}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/layers/normalization/rms_normalization.py:86 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"}