From dc83418259b042fedaea389226a4fd69088a42e0 Mon Sep 17 00:00:00 2001 From: cmoineau <cyril.moineau@cea.fr> Date: Thu, 11 Jan 2024 13:36:34 +0000 Subject: [PATCH] [PyBind] Add set input/output method for OperatorTensor. --- python_binding/operator/pybind_OperatorTensor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python_binding/operator/pybind_OperatorTensor.cpp b/python_binding/operator/pybind_OperatorTensor.cpp index ce34dea15..386a3af6c 100644 --- a/python_binding/operator/pybind_OperatorTensor.cpp +++ b/python_binding/operator/pybind_OperatorTensor.cpp @@ -21,6 +21,9 @@ void init_OperatorTensor(py::module& m){ py::class_<OperatorTensor, std::shared_ptr<OperatorTensor>, Operator>(m, "OperatorTensor") .def("get_output", &OperatorTensor::getOutput, py::arg("outputIdx")) .def("get_input", &OperatorTensor::getInput, py::arg("inputIdx")) + + .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("output_dims_forwarded", &OperatorTensor::outputDimsForwarded) ; } -- GitLab