Skip to content
Snippets Groups Projects
Commit b97a42bc authored by Houssem ROUIS's avatar Houssem ROUIS
Browse files

fix reshape pybind

parent 67049f1c
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,6 @@ void init_Reshape(py::module& m) { ...@@ -23,6 +23,6 @@ void init_Reshape(py::module& m) {
.def("get_inputs_name", &Reshape_Op::getInputsName) .def("get_inputs_name", &Reshape_Op::getInputsName)
.def("get_outputs_name", &Reshape_Op::getOutputsName); .def("get_outputs_name", &Reshape_Op::getOutputsName);
declare_registrable<Reshape_Op>(m, "ReshapeOp"); declare_registrable<Reshape_Op>(m, "ReshapeOp");
m.def("Reshape", &Reshape, py::arg("shape") = std::vector<std::int64_t>(), py::arg("name") = ""); m.def("Reshape", &Reshape, py::arg("shape") = std::vector<std::int64_t>(), py::arg("allowzero") = false, py::arg("name") = "");
} }
} // namespace Aidge } // namespace Aidge
...@@ -97,7 +97,9 @@ bool Aidge::Reshape_Op::forwardDims(bool /*allowDataDependency*/) { ...@@ -97,7 +97,9 @@ bool Aidge::Reshape_Op::forwardDims(bool /*allowDataDependency*/) {
dimSize = getInput(0) -> dims()[i]; dimSize = getInput(0) -> dims()[i];
} }
outDims.push_back(static_cast<DimSize_t>(dimSize)); outDims.push_back(static_cast<DimSize_t>(dimSize));
outSize *= static_cast<DimSize_t>(dimSize); if (dimSize != 0) {
outSize *= static_cast<DimSize_t>(dimSize);
}
} }
if (foundNegativeDimension) { if (foundNegativeDimension) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment