copy() and deepcopy() methods for PartialShape. (#14136)

* Added copy and deepcopy methods for PartialShape.

* Clang format.
This commit is contained in:
Anastasiia Pnevskaia
2022-11-22 22:09:30 +01:00
committed by GitHub
parent 256b27c381
commit 74758c0ca5

View File

@@ -190,5 +190,16 @@ void regclass_graph_PartialShape(py::module m) {
return "<PartialShape: " + py::cast(self).attr("__str__")().cast<std::string>() + ">";
});
shape.def("__copy__", [](const ov::PartialShape& self) -> ov::PartialShape {
return ov::PartialShape(self);
});
shape.def(
"__deepcopy__",
[](const ov::PartialShape& self, py::dict) -> ov::PartialShape {
return ov::PartialShape(self);
},
"memo");
shape.def("to_string", &ov::PartialShape::to_string);
}