{"record":{"id":"74c174e3030b96e6","repo":"keras-team/keras","slug":"could-not-extract-num-value-from-tensor","errorCode":null,"errorMessage":"Could not extract num value from tensor","messagePattern":"Could not extract num value from tensor","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/openvino/numpy.py","lineNumber":2675,"sourceCode":"    If `retstep` is True, also returns the step size between values.\n\n    \"\"\"\n\n    start = get_ov_output(start)\n    stop = get_ov_output(stop)\n\n    if hasattr(num, \"output\") or isinstance(num, OpenVINOKerasTensor):\n        num_tensor = get_ov_output(num)\n        try:\n            if num_tensor.get_node().get_type_name() == \"Constant\":\n                num_value = num_tensor.get_node().get_vector()[0]\n                num = int(num_value)\n            else:\n                raise NotImplementedError(\n                    \"Dynamic num values not fully supported\"\n                )\n        except Exception as e:\n            raise NotImplementedError(\n                \"Could not extract num value from tensor\"\n            ) from e\n    else:\n        num = int(num)\n\n    if dtype is None:\n        output_type = OPENVINO_DTYPES[config.floatx()]\n    else:\n        output_type = OPENVINO_DTYPES[dtype]\n\n    start = ov_opset.convert(start, output_type).output(0)\n    stop = ov_opset.convert(stop, output_type).output(0)\n\n    if num < 0:\n        raise ValueError(\"Number of samples, `num`, must be non-negative.\")\n\n    if num == 0:\n        empty_shape = ov_opset.constant([0], Type.i32).output(0)","sourceCodeStart":2657,"sourceCodeEnd":2693,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/openvino/numpy.py#L2657-L2693","documentation":"Error \"Could not extract num value from tensor\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/openvino/numpy.py:2675 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"}