{"record":{"id":"53c143b6390da411","repo":"keras-team/keras","slug":"invalid-axis-values-received-axis-axis","errorCode":null,"errorMessage":"Invalid axis values. Received: axis={axis}","messagePattern":"Invalid axis values\\. Received: axis=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/tensorflow/linalg.py","lineNumber":168,"sourceCode":"                )\n            elif ord == 2:\n                x = tf.math.reduce_max(\n                    tf.linalg.svd(x, compute_uv=False), axis=-1\n                )\n            else:\n                x = tf.math.reduce_sum(\n                    tf.linalg.svd(x, compute_uv=False), axis=-1\n                )\n            if keepdims:\n                x = tf.expand_dims(x, axis[0])\n                x = tf.expand_dims(x, axis[1])\n        else:\n            raise ValueError(\n                f\"Invalid `ord` argument for matrix norm. Received: ord={ord}\"\n            )\n        return x\n    else:\n        raise ValueError(f\"Invalid axis values. Received: axis={axis}\")\n\n\ndef qr(x, mode=\"reduced\"):\n    if mode not in {\"reduced\", \"complete\"}:\n        raise ValueError(\n            \"`mode` argument value not supported. \"\n            \"Expected one of {'reduced', 'complete'}. \"\n            f\"Received: mode={mode}\"\n        )\n    if mode == \"reduced\":\n        return tf.linalg.qr(x)\n    return tf.linalg.qr(x, full_matrices=True)\n\n\ndef solve(a, b):\n    # tensorflow.linalg.solve only supports same rank inputs\n    if b.shape.ndims == a.shape.ndims - 1:\n        b = tf.expand_dims(b, axis=-1)","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/tensorflow/linalg.py#L150-L186","documentation":"Error \"Invalid axis values. Received: axis={axis}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/tensorflow/linalg.py:168 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"}