{"record":{"id":"0e82061b6480dca1","repo":"keras-team/keras","slug":"invalid-ord-argument-for-vector-norm-received","errorCode":null,"errorMessage":"Invalid `ord` argument for vector norm. Received: ord={ord}","messagePattern":"Invalid `ord` argument for vector norm\\. Received: ord=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/tensorflow/linalg.py","lineNumber":96,"sourceCode":"            return tf.sqrt(\n                tf.reduce_sum(x * tf.math.conj(x), axis=axis, keepdims=keepdims)\n            )\n        elif ord == float(\"inf\"):\n            return tf.math.reduce_max(\n                tf.math.abs(x), axis=axis, keepdims=keepdims\n            )\n        elif ord == float(\"-inf\"):\n            return tf.math.reduce_min(\n                tf.math.abs(x), axis=axis, keepdims=keepdims\n            )\n        elif ord == 0:\n            return tf.math.reduce_sum(\n                tf.cast(tf.not_equal(x, 0), dtype=x.dtype),\n                axis=axis,\n                keepdims=keepdims,\n            )\n        elif isinstance(ord, str):\n            raise ValueError(\n                f\"Invalid `ord` argument for vector norm. Received: ord={ord}\"\n            )\n        else:\n            ord = convert_to_tensor(ord, dtype=x.dtype)\n            out = tf.math.reduce_sum(\n                tf.pow(tf.math.abs(x), ord), axis=axis, keepdims=keepdims\n            )\n            return tf.pow(out, 1.0 / ord)\n    elif num_axes == 2:\n        row_axis, col_axis = axis[0], axis[1]\n        row_axis = row_axis + ndim if row_axis < 0 else row_axis\n        col_axis = col_axis + ndim if col_axis < 0 else col_axis\n        if ord is None or ord == \"fro\":\n            return tf.sqrt(\n                tf.reduce_sum(x * tf.math.conj(x), axis=axis, keepdims=keepdims)\n            )\n        elif ord == 1:\n            if not keepdims and col_axis > row_axis:","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/tensorflow/linalg.py#L78-L114","documentation":"Error \"Invalid `ord` argument for vector norm. Received: ord={ord}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/tensorflow/linalg.py:96 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"}