{"record":{"id":"e376819294038ab9","repo":"keras-team/keras","slug":"mode-argument-value-not-supported-expected-one-e37681","errorCode":null,"errorMessage":"`mode` argument value not supported. Expected one of {'reduced', 'complete'}. Received: mode={mode}","messagePattern":"`mode` argument value not supported\\. Expected one of (.+?)\\. Received: mode=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/tensorflow/linalg.py","lineNumber":173,"sourceCode":"            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)\n        return tf.squeeze(tf.linalg.solve(a, b), axis=-1)\n    return tf.linalg.solve(a, b)\n\n\ndef solve_triangular(a, b, lower=False):","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/tensorflow/linalg.py#L155-L191","documentation":"Error \"`mode` argument value not supported. Expected one of {'reduced', 'complete'}. Received: mode={mode}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/tensorflow/linalg.py:173 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"}