{"record":{"id":"ff939786963443f7","repo":"keras-team/keras","slug":"input-array-must-have-at-least-2-dimensions-recei","errorCode":null,"errorMessage":"Input array must have at least 2 dimensions. Received: array.ndim={array.ndim}","messagePattern":"Input array must have at least 2 dimensions\\. Received: array\\.ndim=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/jax/numpy.py","lineNumber":35,"sourceCode":"from keras.src.backend.jax.core import convert_to_tensor\n\n\ndef _uses_cpu(x):\n    if hasattr(x, \"device\"):\n        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","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/jax/numpy.py#L17-L53","documentation":"Error \"Input array must have at least 2 dimensions. Received: array.ndim={array.ndim}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/jax/numpy.py:35 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"}