{"record":{"id":"d1df650ece626afe","repo":"keras-team/keras","slug":"axis-self-axis-is-out-of-bounds-for-input-shape","errorCode":null,"errorMessage":"Axis {self.axis} is out of bounds for input shape {input_shape}.","messagePattern":"Axis (.+?) is out of bounds for input shape (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/layers/normalization/unit_normalization.py","lineNumber":55,"sourceCode":"                f\"Received: axis={axis}\"\n            )\n        self.supports_masking = True\n\n        self._build_at_init()\n\n    def call(self, inputs):\n        return ops.normalize(inputs, axis=self.axis, order=2, epsilon=1e-12)\n\n    def compute_output_shape(self, input_shape):\n        # Ensure axis is always treated as a list\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 {self.axis} is out of bounds for \"\n                    f\"input shape {input_shape}.\"\n                )\n        return input_shape\n\n    def get_config(self):\n        config = super().get_config()\n        config.update({\"axis\": self.axis})\n        return config\n","sourceCodeStart":37,"sourceCodeEnd":65,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/layers/normalization/unit_normalization.py#L37-L65","documentation":"Error \"Axis {self.axis} is out of bounds for input shape {input_shape}.\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/layers/normalization/unit_normalization.py:55 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"}