Skip to content
Snippets Groups Projects
Commit 95481066 authored by Maxence Naud's avatar Maxence Naud
Browse files

Merge branch 'fix_pybind_classmethod' into 'dev'

Fix pybind classmethod

See merge request eclipse/aidge/aidge_core!124
parents 97d2fef9 e2ec60d3
No related branches found
No related tags found
No related merge requests found
...@@ -28,9 +28,9 @@ void declare_ReduceMeanOp(py::module &m) { ...@@ -28,9 +28,9 @@ void declare_ReduceMeanOp(py::module &m) {
const std::string pyClassName("ReduceMeanOp"); const std::string pyClassName("ReduceMeanOp");
py::class_<ReduceMean_Op, std::shared_ptr<ReduceMean_Op>, Attributes, OperatorTensor>( py::class_<ReduceMean_Op, std::shared_ptr<ReduceMean_Op>, Attributes, OperatorTensor>(
m, pyClassName.c_str(), py::multiple_inheritance()) m, pyClassName.c_str(), py::multiple_inheritance())
.def("get_inputs_name", &ReduceMean_Op::getInputsName) .def_static("get_inputs_name", &ReduceMean_Op::getInputsName)
.def("get_outputs_name", &ReduceMean_Op::getOutputsName) .def_static("get_outputs_name", &ReduceMean_Op::getOutputsName)
.def("attributes_name", &ReduceMean_Op::staticGetAttrsName) .def_static("attributes_name", &ReduceMean_Op::staticGetAttrsName)
; ;
declare_registrable<ReduceMean_Op>(m, pyClassName); declare_registrable<ReduceMean_Op>(m, pyClassName);
......
...@@ -20,8 +20,8 @@ namespace Aidge { ...@@ -20,8 +20,8 @@ namespace Aidge {
void init_Reshape(py::module& m) { void init_Reshape(py::module& m) {
py::class_<Reshape_Op, std::shared_ptr<Reshape_Op>, Attributes, OperatorTensor>(m, "ReshapeOp", py::multiple_inheritance()) py::class_<Reshape_Op, std::shared_ptr<Reshape_Op>, Attributes, OperatorTensor>(m, "ReshapeOp", py::multiple_inheritance())
.def("get_inputs_name", &Reshape_Op::getInputsName) .def_static("get_inputs_name", &Reshape_Op::getInputsName)
.def("get_outputs_name", &Reshape_Op::getOutputsName); .def_static("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("name") = "");
} }
......
...@@ -19,12 +19,12 @@ namespace py = pybind11; ...@@ -19,12 +19,12 @@ namespace py = pybind11;
namespace Aidge { namespace Aidge {
void init_Scaling(py::module& m) void init_Scaling(py::module& m)
{ {
py::class_<Scaling_Op, std::shared_ptr<Scaling_Op>, Attributes, OperatorTensor>(m, "ScalingOp", py::multiple_inheritance()) py::class_<Scaling_Op, std::shared_ptr<Scaling_Op>, Attributes, OperatorTensor>(m, "ScalingOp", py::multiple_inheritance())
.def("get_inputs_name", &Scaling_Op::getInputsName) .def_static("get_inputs_name", &Scaling_Op::getInputsName)
.def("get_outputs_name", &Scaling_Op::getOutputsName) .def_static("get_outputs_name", &Scaling_Op::getOutputsName)
.def("attributes_name", &Scaling_Op::staticGetAttrsName); .def_static("attributes_name", &Scaling_Op::staticGetAttrsName);
declare_registrable<Scaling_Op>(m, "ScalingOp"); declare_registrable<Scaling_Op>(m, "ScalingOp");
m.def("Scaling", &Scaling, py::arg("scaling_factor") = 1.0f, py::arg("nb_bits") = 8, py::arg("is_output_unsigned") = true, py::arg("name") = ""); m.def("Scaling", &Scaling, py::arg("scaling_factor") = 1.0f, py::arg("nb_bits") = 8, py::arg("is_output_unsigned") = true, py::arg("name") = "");
} }
......
...@@ -20,8 +20,8 @@ namespace Aidge { ...@@ -20,8 +20,8 @@ namespace Aidge {
void init_Sigmoid(py::module& m) { void init_Sigmoid(py::module& m) {
py::class_<Sigmoid_Op, std::shared_ptr<Sigmoid_Op>, OperatorTensor>(m, "SigmoidOp", py::multiple_inheritance()) py::class_<Sigmoid_Op, std::shared_ptr<Sigmoid_Op>, OperatorTensor>(m, "SigmoidOp", py::multiple_inheritance())
.def("get_inputs_name", &Sigmoid_Op::getInputsName) .def_static("get_inputs_name", &Sigmoid_Op::getInputsName)
.def("get_outputs_name", &Sigmoid_Op::getOutputsName); .def_static("get_outputs_name", &Sigmoid_Op::getOutputsName);
m.def("Sigmoid", &Sigmoid, py::arg("name") = ""); m.def("Sigmoid", &Sigmoid, py::arg("name") = "");
} }
......
...@@ -21,8 +21,8 @@ namespace Aidge { ...@@ -21,8 +21,8 @@ namespace Aidge {
void init_Slice(py::module& m) { void init_Slice(py::module& m) {
py::class_<Slice_Op, std::shared_ptr<Slice_Op>, OperatorTensor>(m, "SliceOp", py::multiple_inheritance()) py::class_<Slice_Op, std::shared_ptr<Slice_Op>, OperatorTensor>(m, "SliceOp", py::multiple_inheritance())
.def("get_inputs_name", &Slice_Op::getInputsName) .def_static("get_inputs_name", &Slice_Op::getInputsName)
.def("get_outputs_name", &Slice_Op::getOutputsName); .def_static("get_outputs_name", &Slice_Op::getOutputsName);
declare_registrable<Slice_Op>(m, "SliceOp"); declare_registrable<Slice_Op>(m, "SliceOp");
m.def("Slice", m.def("Slice",
......
...@@ -21,9 +21,9 @@ namespace Aidge { ...@@ -21,9 +21,9 @@ namespace Aidge {
void init_Softmax(py::module& m) { void init_Softmax(py::module& m) {
py::class_<Softmax_Op, std::shared_ptr<Softmax_Op>, Attributes, OperatorTensor>(m, "SoftmaxOp", py::multiple_inheritance()) py::class_<Softmax_Op, std::shared_ptr<Softmax_Op>, Attributes, OperatorTensor>(m, "SoftmaxOp", py::multiple_inheritance())
.def("get_inputs_name", &Softmax_Op::getInputsName) .def_static("get_inputs_name", &Softmax_Op::getInputsName)
.def("get_outputs_name", &Softmax_Op::getOutputsName) .def_static("get_outputs_name", &Softmax_Op::getOutputsName)
.def("attributes_name", &Softmax_Op::staticGetAttrsName); .def_static("attributes_name", &Softmax_Op::staticGetAttrsName);
declare_registrable<Softmax_Op>(m, "SoftmaxOp"); declare_registrable<Softmax_Op>(m, "SoftmaxOp");
m.def("Softmax", &Softmax, py::arg("axis"), py::arg("name") = ""); m.def("Softmax", &Softmax, py::arg("axis"), py::arg("name") = "");
} }
......
...@@ -20,8 +20,8 @@ namespace Aidge { ...@@ -20,8 +20,8 @@ namespace Aidge {
void init_Sqrt(py::module& m) { void init_Sqrt(py::module& m) {
py::class_<Sqrt_Op, std::shared_ptr<Sqrt_Op>, OperatorTensor>(m, "SqrtOp", py::multiple_inheritance()) py::class_<Sqrt_Op, std::shared_ptr<Sqrt_Op>, OperatorTensor>(m, "SqrtOp", py::multiple_inheritance())
.def("get_inputs_name", &Sqrt_Op::getInputsName) .def_static("get_inputs_name", &Sqrt_Op::getInputsName)
.def("get_outputs_name", &Sqrt_Op::getOutputsName); .def_static("get_outputs_name", &Sqrt_Op::getOutputsName);
declare_registrable<Sqrt_Op>(m, "SqrtOp"); declare_registrable<Sqrt_Op>(m, "SqrtOp");
m.def("Sqrt", &Sqrt, py::arg("name") = ""); m.def("Sqrt", &Sqrt, py::arg("name") = "");
} }
......
...@@ -20,8 +20,8 @@ namespace Aidge { ...@@ -20,8 +20,8 @@ namespace Aidge {
void init_Sub(py::module& m) { void init_Sub(py::module& m) {
py::class_<Sub_Op, std::shared_ptr<Sub_Op>, OperatorTensor>(m, "SubOp", py::multiple_inheritance()) py::class_<Sub_Op, std::shared_ptr<Sub_Op>, OperatorTensor>(m, "SubOp", py::multiple_inheritance())
.def("get_inputs_name", &Sub_Op::getInputsName) .def_static("get_inputs_name", &Sub_Op::getInputsName)
.def("get_outputs_name", &Sub_Op::getOutputsName); .def_static("get_outputs_name", &Sub_Op::getOutputsName);
declare_registrable<Sub_Op>(m, "SubOp"); declare_registrable<Sub_Op>(m, "SubOp");
m.def("Sub", &Sub, py::arg("name") = ""); m.def("Sub", &Sub, py::arg("name") = "");
} }
......
...@@ -20,8 +20,8 @@ namespace Aidge { ...@@ -20,8 +20,8 @@ namespace Aidge {
void init_Tanh(py::module& m) { void init_Tanh(py::module& m) {
py::class_<Tanh_Op, std::shared_ptr<Tanh_Op>, OperatorTensor>(m, "TanhOp", py::multiple_inheritance()) py::class_<Tanh_Op, std::shared_ptr<Tanh_Op>, OperatorTensor>(m, "TanhOp", py::multiple_inheritance())
.def("get_inputs_name", &Tanh_Op::getInputsName) .def_static("get_inputs_name", &Tanh_Op::getInputsName)
.def("get_outputs_name", &Tanh_Op::getOutputsName); .def_static("get_outputs_name", &Tanh_Op::getOutputsName);
m.def("Tanh", &Tanh, py::arg("name") = ""); m.def("Tanh", &Tanh, py::arg("name") = "");
} }
......
...@@ -29,9 +29,9 @@ void declare_Transpose(py::module &m) { ...@@ -29,9 +29,9 @@ void declare_Transpose(py::module &m) {
const std::string pyClassName("TransposeOp"); const std::string pyClassName("TransposeOp");
py::class_<Transpose_Op, std::shared_ptr<Transpose_Op>, Attributes, OperatorTensor>( py::class_<Transpose_Op, std::shared_ptr<Transpose_Op>, Attributes, OperatorTensor>(
m, "TransposeOp", py::multiple_inheritance()) m, "TransposeOp", py::multiple_inheritance())
.def("get_inputs_name", &Transpose_Op::getInputsName) .def_static("get_inputs_name", &Transpose_Op::getInputsName)
.def("get_outputs_name", &Transpose_Op::getOutputsName) .def_static("get_outputs_name", &Transpose_Op::getOutputsName)
.def("attributes_name", &Transpose_Op::staticGetAttrsName); .def_static("attributes_name", &Transpose_Op::staticGetAttrsName);
declare_registrable<Transpose_Op>(m, pyClassName); declare_registrable<Transpose_Op>(m, pyClassName);
m.def("Transpose", &Transpose, py::arg("output_dims_order"), py::arg("name") = ""); m.def("Transpose", &Transpose, py::arg("output_dims_order"), py::arg("name") = "");
} }
......
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