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

add pybind changes

parent 4a1682e7
No related branches found
No related tags found
2 merge requests!152Update Aidge export to take a graph view has an argument instead of a...,!129Remove import warnings
......@@ -20,6 +20,7 @@ namespace Aidge {
void init_Reshape(py::module& m) {
py::class_<Reshape_Op, std::shared_ptr<Reshape_Op>, Attributes, OperatorTensor>(m, "ReshapeOp", py::multiple_inheritance())
.def(py::init<const std::vector<std::int64_t>&>(), py::arg("shape"))
.def_static("get_inputs_name", &Reshape_Op::getInputsName)
.def_static("get_outputs_name", &Reshape_Op::getOutputsName);
declare_registrable<Reshape_Op>(m, "ReshapeOp");
......
......@@ -22,6 +22,7 @@ namespace Aidge {
void init_Scaling(py::module& m)
{
py::class_<Scaling_Op, std::shared_ptr<Scaling_Op>, Attributes, OperatorTensor>(m, "ScalingOp", py::multiple_inheritance())
.def(py::init<float, size_t, bool>(), py::arg("scaling_factor"), py::arg("nb_bits"), py::arg("is_output_unsigned"))
.def_static("get_inputs_name", &Scaling_Op::getInputsName)
.def_static("get_outputs_name", &Scaling_Op::getOutputsName)
.def_static("attributes_name", &Scaling_Op::staticGetAttrsName);
......
......@@ -20,6 +20,7 @@ namespace Aidge {
void init_Sigmoid(py::module& m) {
py::class_<Sigmoid_Op, std::shared_ptr<Sigmoid_Op>, OperatorTensor>(m, "SigmoidOp", py::multiple_inheritance())
.def(py::init<>())
.def_static("get_inputs_name", &Sigmoid_Op::getInputsName)
.def_static("get_outputs_name", &Sigmoid_Op::getOutputsName);
......
......@@ -21,6 +21,12 @@ namespace Aidge {
void init_Slice(py::module& m) {
py::class_<Slice_Op, std::shared_ptr<Slice_Op>, OperatorTensor>(m, "SliceOp", py::multiple_inheritance())
.def(py::init<const std::vector<std::int64_t>&,
const std::vector<std::int64_t>&,
const std::vector<std::int8_t>&>(),
py::arg("starts"),
py::arg("ends"),
py::arg("axes"))
.def_static("get_inputs_name", &Slice_Op::getInputsName)
.def_static("get_outputs_name", &Slice_Op::getOutputsName);
declare_registrable<Slice_Op>(m, "SliceOp");
......
......@@ -21,6 +21,7 @@ namespace Aidge {
void init_Softmax(py::module& m) {
py::class_<Softmax_Op, std::shared_ptr<Softmax_Op>, Attributes, OperatorTensor>(m, "SoftmaxOp", py::multiple_inheritance())
.def(py::init<std::size_t>(), py::arg("axis"))
.def_static("get_inputs_name", &Softmax_Op::getInputsName)
.def_static("get_outputs_name", &Softmax_Op::getOutputsName)
.def_static("attributes_name", &Softmax_Op::staticGetAttrsName);
......
......@@ -20,6 +20,7 @@ namespace Aidge {
void init_Sqrt(py::module& m) {
py::class_<Sqrt_Op, std::shared_ptr<Sqrt_Op>, OperatorTensor>(m, "SqrtOp", py::multiple_inheritance())
.def(py::init<>())
.def_static("get_inputs_name", &Sqrt_Op::getInputsName)
.def_static("get_outputs_name", &Sqrt_Op::getOutputsName);
declare_registrable<Sqrt_Op>(m, "SqrtOp");
......
......@@ -20,6 +20,7 @@ namespace Aidge {
void init_Sub(py::module& m) {
py::class_<Sub_Op, std::shared_ptr<Sub_Op>, OperatorTensor>(m, "SubOp", py::multiple_inheritance())
.def(py::init<>())
.def_static("get_inputs_name", &Sub_Op::getInputsName)
.def_static("get_outputs_name", &Sub_Op::getOutputsName);
declare_registrable<Sub_Op>(m, "SubOp");
......
......@@ -20,6 +20,7 @@ namespace Aidge {
void init_Tanh(py::module& m) {
py::class_<Tanh_Op, std::shared_ptr<Tanh_Op>, OperatorTensor>(m, "TanhOp", py::multiple_inheritance())
.def(py::init<>())
.def_static("get_inputs_name", &Tanh_Op::getInputsName)
.def_static("get_outputs_name", &Tanh_Op::getOutputsName);
......
......@@ -29,6 +29,7 @@ void declare_Transpose(py::module &m) {
const std::string pyClassName("TransposeOp");
py::class_<Transpose_Op, std::shared_ptr<Transpose_Op>, Attributes, OperatorTensor>(
m, "TransposeOp", py::multiple_inheritance())
.def(py::init<const std::vector<DimSize_t>&>(), py::arg("output_dims_order"))
.def_static("get_inputs_name", &Transpose_Op::getInputsName)
.def_static("get_outputs_name", &Transpose_Op::getOutputsName)
.def_static("attributes_name", &Transpose_Op::staticGetAttrsName);
......
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