{"record":{"id":"960848adc98b178e","repo":"keras-team/keras","slug":"pad-operation-supports-only-scalar-pad-value-in","errorCode":null,"errorMessage":"`pad` operation supports only scalar pad value in constant mode with the openvino backend. Received: constant_values={constant_values}","messagePattern":"`pad` operation supports only scalar pad value in constant mode with the openvino backend\\. Received: constant_values=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/openvino/numpy.py","lineNumber":3879,"sourceCode":"    result = ov_opset.multiply(x1_reshaped, x2_reshaped).output(0)\n\n    return OpenVINOKerasTensor(result)\n\n\ndef pad(x, pad_width, mode=\"constant\", constant_values=None):\n    x = get_ov_output(x)\n    pad_value = None\n    if constant_values is not None:\n        if mode != \"constant\":\n            raise ValueError(\n                \"Argument `constant_values` can only be \"\n                \"provided when `mode == 'constant'`. \"\n                f\"Received: mode={mode}\"\n            )\n        if not isinstance(\n            constant_values, (int, float, np.integer, np.floating)\n        ):\n            raise ValueError(\n                \"`pad` operation supports only scalar pad value \"\n                \"in constant mode with the openvino backend. \"\n                f\"Received: constant_values={constant_values}\"\n            )\n        pad_value = ov_opset.constant(\n            constant_values, x.get_element_type()\n        ).output(0)\n\n    # split pad_width into two tensors pads_begin and pads_end\n    pads_begin = []\n    pads_end = []\n    for pads_pair in pad_width:\n        pads_begin.append(pads_pair[0])\n        pads_end.append(pads_pair[1])\n    pads_begin = ov_opset.constant(pads_begin, Type.i32).output(0)\n    pads_end = ov_opset.constant(pads_end, Type.i32).output(0)\n    return OpenVINOKerasTensor(\n        ov_opset.pad(x, pads_begin, pads_end, mode, pad_value).output(0)","sourceCodeStart":3861,"sourceCodeEnd":3897,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/openvino/numpy.py#L3861-L3897","documentation":"Error \"`pad` operation supports only scalar pad value in constant mode with the openvino backend. Received: constant_values={constant_values}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/openvino/numpy.py:3879 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"}