{"record":{"id":"5e5637452aa32190","repo":"keras-team/keras","slug":"cannot-use-array-split-with-static-python-logic-on","errorCode":null,"errorMessage":"Cannot use array_split with static Python logic on dynamic axis. Axis {axis} has unknown dimension for shape {original_shape}.","messagePattern":"Cannot use array_split with static Python logic on dynamic axis\\. Axis (.+?) has unknown dimension for shape (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/openvino/numpy.py","lineNumber":4398,"sourceCode":"        splits = ov_opset.variadic_split(x, axis_tensor, length_tensor)\n        result = []\n        for i in range(len(split_lengths) + 1):\n            result.append(OpenVINOKerasTensor(splits.output(i)))\n        return result\n\n    raise TypeError(\n        f\"unsupported type of indices_or_sections: {type(indices_or_sections)}\"\n    )\n\n\ndef array_split(x, indices_or_sections, axis=0):\n    original_shape = x.shape\n    x = get_ov_output(x)\n\n    num_splits_val = indices_or_sections\n    total_size = original_shape[axis]\n    if total_size is None:\n        raise ValueError(\n            f\"Cannot use array_split with static Python logic on dynamic axis. \"\n            f\"Axis {axis} has unknown dimension for shape {original_shape}.\"\n        )\n\n    base_size = total_size // num_splits_val\n    remainder = total_size % num_splits_val\n\n    split_lengths = [base_size + 1] * remainder + [base_size] * (\n        num_splits_val - remainder\n    )\n    split_lengths_tensor = ov_opset.constant(\n        split_lengths, dtype=Type.i64\n    ).output(0)\n\n    axis_tensor = ov_opset.constant(axis, dtype=Type.i32).output(0)\n    splits = ov_opset.variadic_split(x, axis_tensor, split_lengths_tensor)\n\n    result = []","sourceCodeStart":4380,"sourceCodeEnd":4416,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/openvino/numpy.py#L4380-L4416","documentation":"Error \"Cannot use array_split with static Python logic on dynamic axis. Axis {axis} has unknown dimension for shape {original_shape}.\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/openvino/numpy.py:4398 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"}