Fix vector casting for Constants with float16 type (#10088)

This commit is contained in:
Jan Iwaszkiewicz 2022-02-03 09:15:28 +01:00 committed by GitHub
parent 38ed0de9cf
commit db334efbbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,6 +57,12 @@ py::array _cast_vector(const ov::op::v0::Constant& self) {
return py::array(vec.size(), vec.data());
}
template <>
py::array _cast_vector<ov::float16>(const ov::op::v0::Constant& self) {
auto vec = self.cast_vector<ov::float16>();
return py::array(py::dtype("float16"), vec.size(), vec.data());
}
void regclass_graph_op_Constant(py::module m) {
py::class_<ov::op::v0::Constant, std::shared_ptr<ov::op::v0::Constant>, ov::Node> constant(m,
"Constant",