{"record":{"id":"a5d367e95420e4ca","repo":"keras-team/keras","slug":"invalid-axes-axes-axes-must-be-a-tuple-of-two","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":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/jax/numpy.py","lineNumber":40,"sourceCode":"        device = x.device\n        if not isinstance(device, jax.Device):\n            # Array is sharded.\n            return False\n        return device.platform == \"cpu\"\n    else:\n        # This is a Tracer, not a concrete Array.\n        return jax.default_backend() == \"cpu\"\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            f\"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 of \"\n            \"two different dimensions.\"\n        )\n    return jnp.rot90(array, k=k, axes=axes)\n\n\n@sparse.elementwise_binary_union(linear=True, use_sparsify=True)\ndef add(x1, x2):\n    x1 = convert_to_tensor(x1)\n    x2 = convert_to_tensor(x2)\n    return jnp.add(x1, x2)\n\n\ndef bartlett(x):\n    x = convert_to_tensor(x)\n    return cast(jnp.bartlett(x), config.floatx())\n\n","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/jax/numpy.py#L22-L58","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/jax/numpy.py:40 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"}