[PyOV] Add get_byte_size to const node (#20759)

This commit is contained in:
Anastasia Kuporosova 2023-10-30 19:46:07 +01:00 committed by GitHub
parent c21fd2ea61
commit 5b583276b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -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) {

View File

@ -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():