From 5b583276b226657846ba78def837e355199adf14 Mon Sep 17 00:00:00 2001 From: Anastasia Kuporosova Date: Mon, 30 Oct 2023 19:46:07 +0100 Subject: [PATCH] [PyOV] Add get_byte_size to const node (#20759) --- src/bindings/python/src/pyopenvino/graph/ops/constant.cpp | 2 ++ src/bindings/python/tests/test_graph/test_ops.py | 1 + 2 files changed, 3 insertions(+) diff --git a/src/bindings/python/src/pyopenvino/graph/ops/constant.cpp b/src/bindings/python/src/pyopenvino/graph/ops/constant.cpp index 002a674e45c..92f5b0e2ace 100644 --- a/src/bindings/python/src/pyopenvino/graph/ops/constant.cpp +++ b/src/bindings/python/src/pyopenvino/graph/ops/constant.cpp @@ -127,6 +127,8 @@ void regclass_graph_op_Constant(py::module m) { constant.def("get_value_strings", &ov::op::v0::Constant::get_value_strings); + constant.def("get_byte_size", &ov::op::v0::Constant::get_byte_size); + constant.def("get_vector", [](const ov::op::v0::Constant& self) { auto element_type = self.get_element_type(); if (element_type == ov::element::boolean) { diff --git a/src/bindings/python/tests/test_graph/test_ops.py b/src/bindings/python/tests/test_graph/test_ops.py index 1fcaed08222..bd81278cf59 100644 --- a/src/bindings/python/tests/test_graph/test_ops.py +++ b/src/bindings/python/tests/test_graph/test_ops.py @@ -128,6 +128,7 @@ def test_constant(const, args, expectation): assert node.get_output_size() == 1 assert list(node.get_output_shape(0)) == [3, 3] assert node.get_output_element_type(0) == Type.f32 + assert node.get_byte_size() == 36 def test_concat():