diff --git a/python_binding/operator/pybind_AvgPooling.cpp b/python_binding/operator/pybind_AvgPooling.cpp index 24549e3f4f331ee1170a07e61a6190a607274fe3..852b1130354f234d16d048593172735144f993a6 100644 --- a/python_binding/operator/pybind_AvgPooling.cpp +++ b/python_binding/operator/pybind_AvgPooling.cpp @@ -31,17 +31,17 @@ template <DimIdx_t DIM> void declare_AvgPoolingOp(py::module &m) { const std::string pyClassName("AvgPooling" + std::to_string(DIM) + "DOp"); const std::string pyStaticAttrClassName("StaticAttributes" + pyClassName); - + py::class_<AvgPooling_Op<DIM>, std::shared_ptr<AvgPooling_Op<DIM>>, OperatorTensor>( m, pyClassName.c_str(), py::multiple_inheritance(), R"mydelimiter( Initialize an AvgPooling operator for a tensor. - This operator performs average pooling on the input tensor using the specified kernel dimensions + This operator performs average pooling on the input tensor using the specified kernel dimensions and stride dimensions. - :param kernel_dims: The size of the kernel (filter) applied during pooling. + :param kernel_dims: The size of the kernel (filter) applied during pooling. Specifies the dimensions of the kernel (e.g., [3, 3] for 2D pooling). :type kernel_dims: List[int] :param stride_dims: The stride of the pooling operation. Specifies how much the kernel moves in each step. @@ -52,8 +52,8 @@ template <DimIdx_t DIM> void declare_AvgPoolingOp(py::module &m) { const std::array<DimSize_t, DIM> &>(), py::arg("kernel_dims"), py::arg("stride_dims") = create_array<DimSize_t, DIM>(1)) - .def("get_inputs_name", &AvgPooling_Op<DIM>::getInputsName) - .def("get_outputs_name", &AvgPooling_Op<DIM>::getOutputsName) + .def_static("get_inputs_name", &AvgPooling_Op<DIM>::getInputsName) + .def_static("get_outputs_name", &AvgPooling_Op<DIM>::getOutputsName) .def_readonly_static("Type", &AvgPooling_Op<DIM>::Type); declare_registrable<AvgPooling_Op<DIM>>(m, pyClassName); diff --git a/python_binding/operator/pybind_ConstantOfShape.cpp b/python_binding/operator/pybind_ConstantOfShape.cpp index 07079d98301f0f778185d0fb70f6d38b18aec5e8..5a0e858f14c5ac1629abcbd17cec98a232903230 100644 --- a/python_binding/operator/pybind_ConstantOfShape.cpp +++ b/python_binding/operator/pybind_ConstantOfShape.cpp @@ -27,20 +27,20 @@ void init_ConstantOfShape(py::module &m) { R"mydelimiter( Initialize a ConstantOfShape operator. - :param value : Tensor with a given datatype that contains the value + :param value : Tensor with a given datatype that contains the value that will fill the output tensor. :type value : :py:class:`Tensor` )mydelimiter") .def("get_inputs_name", &ConstantOfShape_Op::getInputsName) - .def("get_outputs_name", &ConstantOfShape_Op::getOutputsName) - .def("value", &ConstantOfShape_Op::value); + .def_static("get_outputs_name", &ConstantOfShape_Op::getOutputsName) + .def_static("value", &ConstantOfShape_Op::value); m.def("ConstantOfShape", &ConstantOfShape, py::arg("value") = Tensor(0.f), py::arg("name") = "", R"mydelimiter( Initialize a node containing a ConstantOfShape operator. - :param value : Tensor with a given datatype that contains the value + :param value : Tensor with a given datatype that contains the value that will fill the output tensor. :type value : :py:class:`Tensor` :param name : Name of the node. diff --git a/python_binding/operator/pybind_Squeeze.cpp b/python_binding/operator/pybind_Squeeze.cpp index 188ce745d3a1990ffbf9a80af0ae20bc9cc988fb..f7ee4d7228c35c26316d56d9367b4b906eefc31a 100644 --- a/python_binding/operator/pybind_Squeeze.cpp +++ b/python_binding/operator/pybind_Squeeze.cpp @@ -32,8 +32,8 @@ void init_Squeeze(py::module &m) { & r in [-128 , 127] :type axes: :py:class: List[Int] )mydelimiter") - .def("get_inputs_name", &Squeeze_Op::getInputsName) - .def("get_outputs_name", &Squeeze_Op::getOutputsName) + .def_static("get_inputs_name", &Squeeze_Op::getInputsName) + .def_static("get_outputs_name", &Squeeze_Op::getOutputsName) .def("axes", &Squeeze_Op::axes); declare_registrable<Squeeze_Op>(m, "SqueezeOp"); diff --git a/python_binding/operator/pybind_Unsqueeze.cpp b/python_binding/operator/pybind_Unsqueeze.cpp index 7ef8af8b6cf66abe0373a9fa96f03892e03fbf8a..c21a7bcfa6989fe3f0ab7b9cf121c765a6a0741a 100644 --- a/python_binding/operator/pybind_Unsqueeze.cpp +++ b/python_binding/operator/pybind_Unsqueeze.cpp @@ -28,8 +28,8 @@ void init_Unsqueeze(py::module &m) { :type axes: :py:class: List[Int] )mydelimiter") // Here we bind the methods of the Unsqueeze_Op that will want to access - .def("get_inputs_name", &Unsqueeze_Op::getInputsName) - .def("get_outputs_name", &Unsqueeze_Op::getOutputsName) + .def_static("get_inputs_name", &Unsqueeze_Op::getInputsName) + .def_static("get_outputs_name", &Unsqueeze_Op::getOutputsName) .def_readonly_static("Type", &Unsqueeze_Op::Type) ;