From 8ffe8ae3ca812521c232ff95b4dda42de28dba54 Mon Sep 17 00:00:00 2001 From: Nikita Malinin Date: Wed, 10 Jul 2024 11:13:54 +0200 Subject: [PATCH] Limit .get_data usage --- nncf/openvino/graph/node_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nncf/openvino/graph/node_utils.py b/nncf/openvino/graph/node_utils.py index 1fe658be36d..9d45f7c9bb4 100644 --- a/nncf/openvino/graph/node_utils.py +++ b/nncf/openvino/graph/node_utils.py @@ -109,7 +109,9 @@ def get_const_value(const_node: ov.Node, dtype: ov.Type = ov.Type.f32) -> np.nda :param dtype: Value return type. :return: The constant value. """ - return const_node.get_data(dtype=dtype.to_dtype()) + if const_node.get_element_type() == ov.Type.bf16: + return const_node.get_data(dtype=dtype.to_dtype()) + return const_node.data def get_bias_value(