{"record":{"id":"e2d3c2573ea5c796","repo":"keras-team/keras","slug":"cannot-determine-ndim-tensor-has-a-dynamically","errorCode":null,"errorMessage":"Cannot determine `ndim`: tensor has a dynamically-ranked PartialShape. The OpenVINO backend requires a statically-known rank for this operation.","messagePattern":"Cannot determine `ndim`: tensor has a dynamically-ranked PartialShape\\. The OpenVINO backend requires a statically-known rank for this operation\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/openvino/numpy.py","lineNumber":3798,"sourceCode":"    ).output(0)\n    neginf_mask = ov_opset.is_inf(\n        x,\n        {\"detect_positive\": False, \"detect_negative\": True},\n    ).output(0)\n    nan_mask = ov_opset.is_nan(x).output(0)\n    x = ov_opset.select(nan_mask, nan_val, x).output(0)\n    x = ov_opset.select(posinf_mask, posinf_val, x).output(0)\n    x = ov_opset.select(neginf_mask, neginf_val, x).output(0)\n    if isfloat64:\n        x = ov_opset.convert(x, Type.f64).output(0)\n    return OpenVINOKerasTensor(x)\n\n\ndef ndim(x):\n    x = get_ov_output(x)\n    rank = x.get_partial_shape().rank\n    if not rank.is_static:\n        raise ValueError(\n            \"Cannot determine `ndim`: tensor has a dynamically-ranked \"\n            \"PartialShape. The OpenVINO backend requires a statically-known \"\n            \"rank for this operation.\"\n        )\n    return rank.get_length()\n\n\ndef nonzero(x):\n    x = get_ov_output(x)\n    res = ov_opset.non_zero(data=x, output_type=\"i32\").output(0)\n    return OpenVINOKerasTensor(res)\n\n\ndef not_equal(x1, x2):\n    element_type = None\n    if isinstance(x1, OpenVINOKerasTensor):\n        element_type = x1.output.get_element_type()\n    if isinstance(x2, OpenVINOKerasTensor):","sourceCodeStart":3780,"sourceCodeEnd":3816,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/openvino/numpy.py#L3780-L3816","documentation":"Error \"Cannot determine `ndim`: tensor has a dynamically-ranked PartialShape. The OpenVINO backend requires a statically-known rank for this operation.\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/openvino/numpy.py:3798 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"}