{"record":{"id":"e6d73a3ce5c201d4","repo":"keras-team/keras","slug":"view-from-old-dtype-to-new-dtype-is-not-supp","errorCode":null,"errorMessage":"`view` from {old_dtype} to {new_dtype} is not supported for non-constant tensors with the OpenVINO backend (no bitcast operation available in OpenVINO opset).","messagePattern":"`view` from (.+?) to (.+?) is not supported for non-constant tensors with the OpenVINO backend \\(no bitcast operation available in OpenVINO opset\\)\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/openvino/numpy.py","lineNumber":698,"sourceCode":"            ov_model = ov.Model(results=[x_ov], parameters=[])\n            compiled = ov.compile_model(ov_model, \"CPU\")\n            np_data = compiled({})[0]\n        old_shape = np_data.shape\n        new_last = old_shape[-1] * old_itemsize // new_itemsize\n        new_shape = list(old_shape[:-1]) + [new_last]\n        raw = np.frombuffer(np_data.tobytes(), dtype=np.uint8)\n        result_tensor = ov.Tensor(new_ov_type, new_shape)\n        np.copyto(\n            np.frombuffer(result_tensor.data, dtype=np.uint8),\n            raw,\n        )\n        return OpenVINOKerasTensor(ov_opset.constant(result_tensor).output(0))\n    except Exception:\n        pass\n\n    # Non-constant tensors: only integer↔integer is supported\n    if not (old_ov_type.is_integral() and new_ov_type.is_integral()):\n        raise NotImplementedError(\n            f\"`view` from {old_dtype} to {new_dtype} is not supported \"\n            \"for non-constant tensors with the OpenVINO backend \"\n            \"(no bitcast operation available in OpenVINO opset).\"\n        )\n\n    if old_itemsize == new_itemsize:\n        # Same-width signed↔unsigned: convert preserves bit pattern\n        return OpenVINOKerasTensor(\n            ov_opset.convert(x_ov, new_ov_type).output(0)\n        )\n    elif old_itemsize > new_itemsize:\n        return _view_int_expand(x_ov, new_ov_type, old_itemsize, new_itemsize)\n    else:\n        return _view_int_contract(x_ov, new_ov_type, old_itemsize, new_itemsize)\n\n\ndef _split_shape_leading_last(x):\n    \"\"\"Return (leading_dims, last_dim) from the shape of *x*.","sourceCodeStart":680,"sourceCodeEnd":716,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/openvino/numpy.py#L680-L716","documentation":"Error \"`view` from {old_dtype} to {new_dtype} is not supported for non-constant tensors with the OpenVINO backend (no bitcast operation available in OpenVINO opset).\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/openvino/numpy.py:698 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"}