{"record":{"id":"b39be3e27905af2d","repo":"keras-team/keras","slug":"length-of-start-indices-must-match-length-of-sh","errorCode":null,"errorMessage":"Length of `start_indices` must match length of `shape`. Received: start_indices={start_indices}, shape={shape}","messagePattern":"Length of `start_indices` must match length of `shape`\\. Received: start_indices=(.+?), shape=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/numpy/core.py","lineNumber":367,"sourceCode":"    if reduction is None:\n        inputs[idx] = updates\n    elif reduction == \"add\":\n        np.add.at(inputs, idx, updates)\n    elif reduction == \"max\":\n        np.maximum.at(inputs, idx, updates)\n    elif reduction == \"min\":\n        np.minimum.at(inputs, idx, updates)\n    elif reduction == \"mul\":\n        np.multiply.at(inputs, idx, updates)\n    else:\n        raise ValueError(f\"Unsupported reduction: {reduction}\")\n    return inputs\n\n\ndef slice(inputs, start_indices, shape):\n    # Validate inputs\n    if len(start_indices) != len(shape):\n        raise ValueError(\n            \"Length of `start_indices` must match length of `shape`. \"\n            f\"Received: start_indices={start_indices}, shape={shape}\"\n        )\n\n    # Generate list of indices arrays for each dimension\n    indices = [\n        np.arange(start, start + length)\n        for start, length in zip(start_indices, shape)\n    ]\n\n    # Use np.ix_ to create a multidimensional index array\n    mesh = np.ix_(*indices)\n\n    return inputs[mesh]\n\n\ndef slice_update(inputs, start_indices, updates):\n    # Generate list of indices arrays for each dimension","sourceCodeStart":349,"sourceCodeEnd":385,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/numpy/core.py#L349-L385","documentation":"Error \"Length of `start_indices` must match length of `shape`. Received: start_indices={start_indices}, shape={shape}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/numpy/core.py:367 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"}