{"record":{"id":"36aa816ce2d4f443","repo":"keras-team/keras","slug":"value-must-be-an-integer-tuple-or-list-receive","errorCode":null,"errorMessage":"`value` must be an integer, tuple or list. Received: value={value}","messagePattern":"`value` must be an integer, tuple or list\\. Received: value=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/common/backend_utils.py","lineNumber":431,"sourceCode":"        and isinstance(kernel_input_channels, int)\n        and input_channels != kernel_input_channels\n    ):\n        raise ValueError(\n            \"The number of input channels must match the kernel's input \"\n            f\"channels. Received: input channels={input_channels}, kernel \"\n            f\"input channels={kernel_input_channels}, \"\n            f\"data_format='{data_format}'.\"\n        )\n\n\ndef to_tuple_or_list(value):\n    \"\"\"Convert the non-`None` value to either a tuple or a list.\"\"\"\n    if value is None:\n        return value\n    if hasattr(value, \"tolist\"):  # e.g. numpy array or scalar\n        value = value.tolist()\n    if not isinstance(value, (int, tuple, list)):\n        raise ValueError(\n            \"`value` must be an integer, tuple or list. \"\n            f\"Received: value={value}\"\n        )\n    if isinstance(value, int):\n        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:","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/common/backend_utils.py#L413-L449","documentation":"Error \"`value` must be an integer, tuple or list. Received: value={value}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/common/backend_utils.py:431 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"}