{"record":{"id":"9810f643210aae4a","repo":"keras-team/keras","slug":"input-array-must-have-at-least-2-dimensions-recei-9810f6","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":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/numpy/ops/numpy.py","lineNumber":16,"sourceCode":"import numpy as np\n\nfrom keras.src import backend\nfrom keras.src import tree\nfrom keras.src.backend import config\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.common.variables import standardize_dtype\nfrom keras.src.backend.numpy.ops.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)),","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/numpy/ops/numpy.py#L1-L34","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/numpy/ops/numpy.py:16 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"}