{"record":{"id":"e1779ce632d2d3b5","repo":"keras-team/keras","slug":"invalid-axes-axes-axes-must-be-a-tuple-of-two-e1779c","errorCode":null,"errorMessage":"Invalid axes: {axes}. Axes must be a tuple of two different dimensions.","messagePattern":"Invalid axes: (.+?)\\. Axes must be a tuple of two different dimensions\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/numpy/numpy.py","lineNumber":21,"sourceCode":"from keras.src import backend\nfrom keras.src import tree\nfrom keras.src.backend import config\nfrom keras.src.backend import standardize_dtype\nfrom keras.src.backend.common import dtypes\nfrom keras.src.backend.common.backend_utils import canonicalize_axis\nfrom keras.src.backend.common.backend_utils import standardize_axis_for_numpy\nfrom keras.src.backend.numpy.core import convert_to_tensor\n\n\ndef rot90(array, k=1, axes=(0, 1)):\n    \"\"\"Rotate an array by 90 degrees in the specified plane.\"\"\"\n    if array.ndim < 2:\n        raise ValueError(\n            \"Input array must have at least 2 dimensions. \"\n            f\"Received: array.ndim={array.ndim}\"\n        )\n    if len(axes) != 2 or axes[0] == axes[1]:\n        raise ValueError(\n            f\"Invalid axes: {axes}. Axes must be a tuple \"\n            \"of two different dimensions.\"\n        )\n    return np.rot90(array, k=k, axes=axes)\n\n\ndef add(x1, x2):\n    if not isinstance(x1, (int, float)):\n        x1 = convert_to_tensor(x1)\n    if not isinstance(x2, (int, float)):\n        x2 = convert_to_tensor(x2)\n    dtype = dtypes.result_type(\n        getattr(x1, \"dtype\", type(x1)),\n        getattr(x2, \"dtype\", type(x2)),\n    )\n    x1 = convert_to_tensor(x1, dtype)\n    x2 = convert_to_tensor(x2, dtype)\n    return np.add(x1, x2)","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/numpy/numpy.py#L3-L39","documentation":"Error \"Invalid axes: {axes}. Axes must be a tuple of two different dimensions.\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/numpy/numpy.py:21 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"}