From 5cd4702aa192ebe52d73c030278b18e28f44a155 Mon Sep 17 00:00:00 2001 From: NAUD Maxence <maxence.naud@cea.fr> Date: Tue, 27 Feb 2024 10:07:17 +0000 Subject: [PATCH] Move computeOutputDims() function from GenericOp to OpTensor python binding so that more Operators can use it --- python_binding/operator/pybind_GenericOperator.cpp | 1 - python_binding/operator/pybind_OperatorTensor.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/python_binding/operator/pybind_GenericOperator.cpp b/python_binding/operator/pybind_GenericOperator.cpp index 6be4f31ac..a5435a3ce 100644 --- a/python_binding/operator/pybind_GenericOperator.cpp +++ b/python_binding/operator/pybind_GenericOperator.cpp @@ -24,7 +24,6 @@ void init_GenericOperator(py::module& m) { py::class_<GenericOperator_Op, std::shared_ptr<GenericOperator_Op>, DynamicAttributes, OperatorTensor>(m, "GenericOperatorOp", py::multiple_inheritance()) .def_readonly_static("identity", &GenericOperator_Op::Identity) - .def("compute_output_dims", &GenericOperator_Op::computeOutputDims) .def("set_compute_output_dims", &GenericOperator_Op::setComputeOutputDims, py::arg("computation_function")); // &GenericOperator diff --git a/python_binding/operator/pybind_OperatorTensor.cpp b/python_binding/operator/pybind_OperatorTensor.cpp index 386a3af6c..d0a4d0243 100644 --- a/python_binding/operator/pybind_OperatorTensor.cpp +++ b/python_binding/operator/pybind_OperatorTensor.cpp @@ -24,6 +24,7 @@ void init_OperatorTensor(py::module& m){ .def("set_output", (void (OperatorTensor::*)(const IOIndex_t, const std::shared_ptr<Data>&)) &OperatorTensor::setOutput, py::arg("outputIdx"), py::arg("data")) .def("set_input", (void (OperatorTensor::*)(const IOIndex_t, const std::shared_ptr<Data>&)) &OperatorTensor::setInput, py::arg("outputIdx"), py::arg("data")) + .def("compute_output_dims", &OperatorTensor::computeOutputDims) .def("output_dims_forwarded", &OperatorTensor::outputDimsForwarded) ; } -- GitLab