{"record":{"id":"4833b3508f646617","repo":"keras-team/keras","slug":"shift-and-axis-must-be-broadcastable-to-the-sa","errorCode":null,"errorMessage":"`shift` and `axis` must be broadcastable to the same length. Received: shift={shift}, axis={axis}","messagePattern":"`shift` and `axis` must be broadcastable to the same length\\. Received: shift=(.+?), axis=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/common/backend_utils.py","lineNumber":454,"sourceCode":"        return (value,)\n    return value\n\n\ndef normalize_shift_and_axis(shift, axis):\n    \"\"\"Normalize `shift` and `axis` arguments of `roll` to the same length.\n\n    Mirrors numpy's behavior of broadcasting a scalar (or length-1\n    sequence) `shift`/`axis` against the other argument. Accepts ints,\n    lists, tuples, and array-likes (e.g. numpy arrays).\n    \"\"\"\n    shifts = list(to_tuple_or_list(shift))\n    axes = list(to_tuple_or_list(axis))\n    if len(shifts) == 1:\n        shifts = shifts * len(axes)\n    if len(axes) == 1:\n        axes = axes * len(shifts)\n    if len(shifts) != len(axes):\n        raise ValueError(\n            \"`shift` and `axis` must be broadcastable to the same length. \"\n            f\"Received: shift={shift}, axis={axis}\"\n        )\n    return shifts, axes\n\n\n### Code for ops.vectorize() used for TF and torch backends.\n\n# See http://docs.scipy.org/doc/numpy/reference/c-api.generalized-ufuncs.html\n_DIMENSION_NAME = r\"\\w+\"\n_CORE_DIMENSION_LIST = \"(?:{0:}(?:,{0:})*)?\".format(_DIMENSION_NAME)\n_ARGUMENT = rf\"\\({_CORE_DIMENSION_LIST}\\)\"\n_ARGUMENT_LIST = \"{0:}(?:,{0:})*\".format(_ARGUMENT)\n_SIGNATURE = \"^{0:}->{0:}$\".format(_ARGUMENT_LIST)\n\n\ndef _vectorize_parse_gufunc_signature(\n    signature,","sourceCodeStart":436,"sourceCodeEnd":472,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/common/backend_utils.py#L436-L472","documentation":"Error \"`shift` and `axis` must be broadcastable to the same length. Received: shift={shift}, axis={axis}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/common/backend_utils.py:454 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"}