Skip to content
Snippets Groups Projects
Commit d7a57dbe authored by Grégoire Kubler's avatar Grégoire Kubler
Browse files

Merge remote-tracking branch 'origin/dev' into feat/operator_globalAveragePooling

parents 912edaea a0b56cd9
No related branches found
No related tags found
2 merge requests!105version 0.2.0,!91Feat/operator global average pooling
Showing
with 40 additions and 21 deletions
......@@ -11,6 +11,7 @@
#include <pybind11/pybind11.h>
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/Identity.hpp"
#include "aidge/operator/Operator.hpp"
......
......@@ -11,6 +11,7 @@
#include <pybind11/pybind11.h>
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/LeakyReLU.hpp"
#include "aidge/operator/OperatorTensor.hpp"
......
......@@ -11,8 +11,9 @@
#include <pybind11/pybind11.h>
#include "aidge/operator/MatMul.hpp"
#include "aidge/backend/OperatorImpl.hpp"
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/MatMul.hpp"
#include "aidge/operator/OperatorTensor.hpp"
#include "aidge/utils/Types.h"
......
......@@ -17,10 +17,10 @@
#include <array>
#include "aidge/backend/OperatorImpl.hpp"
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/MaxPooling.hpp"
#include "aidge/operator/OperatorTensor.hpp"
#include "aidge/utils/Types.h"
#include "aidge/data/Tensor.hpp"
namespace py = pybind11;
namespace Aidge {
......
......@@ -11,6 +11,7 @@
#include <pybind11/pybind11.h>
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/Mul.hpp"
#include "aidge/operator/OperatorTensor.hpp"
......
......@@ -11,10 +11,12 @@
********************************************************************************/
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "aidge/backend/OperatorImpl.hpp"
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/Operator.hpp"
#include "aidge/utils/Types.h"
#include <pybind11/stl.h>
namespace py = pybind11;
namespace Aidge {
......
......@@ -10,7 +10,9 @@
********************************************************************************/
#include <pybind11/pybind11.h>
#include "aidge/backend/OperatorImpl.hpp"
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/OperatorTensor.hpp"
#include "aidge/operator/Operator.hpp"
#include <pybind11/stl.h>
......
......@@ -9,14 +9,14 @@
*
********************************************************************************/
#include <array>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <iostream>
#include <string>
#include <vector>
#include <array>
#include "aidge/backend/OperatorImpl.hpp"
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/Pad.hpp"
#include "aidge/operator/Operator.hpp"
#include "aidge/utils/Types.h"
......
......@@ -11,6 +11,7 @@
#include <pybind11/pybind11.h>
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/Pop.hpp"
#include "aidge/operator/OperatorTensor.hpp"
......
......@@ -11,6 +11,7 @@
#include <pybind11/pybind11.h>
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/Pow.hpp"
#include "aidge/operator/OperatorTensor.hpp"
......
......@@ -12,11 +12,11 @@
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "aidge/utils/Types.h"
// #include "aidge/backend/OperatorImpl.hpp"
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/OperatorTensor.hpp"
#include "aidge/operator/Producer.hpp"
#include "aidge/data/Tensor.hpp"
#include "aidge/utils/Types.h"
namespace py = pybind11;
namespace Aidge {
......
......@@ -11,6 +11,7 @@
#include <pybind11/pybind11.h>
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/ReLU.hpp"
#include "aidge/operator/OperatorTensor.hpp"
......
......@@ -9,13 +9,14 @@
*
********************************************************************************/
#include <array>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <string>
#include <vector>
#include <array>
#include "aidge/backend/OperatorImpl.hpp"
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/OperatorTensor.hpp"
#include "aidge/operator/ReduceMean.hpp"
#include "aidge/utils/Types.h"
......@@ -23,22 +24,22 @@
namespace py = pybind11;
namespace Aidge {
template <DimIdx_t DIM> void declare_ReduceMeanOp(py::module &m) {
const std::string pyClassName("ReduceMeanOp" + std::to_string(DIM) + "D");
py::class_<ReduceMean_Op<DIM>, std::shared_ptr<ReduceMean_Op<DIM>>, Attributes, OperatorTensor>(
void declare_ReduceMeanOp(py::module &m) {
const std::string pyClassName("ReduceMeanOp");
py::class_<ReduceMean_Op, std::shared_ptr<ReduceMean_Op>, Attributes, OperatorTensor>(
m, pyClassName.c_str(), py::multiple_inheritance())
.def("get_inputs_name", &ReduceMean_Op<DIM>::getInputsName)
.def("get_outputs_name", &ReduceMean_Op<DIM>::getOutputsName)
.def("attributes_name", &ReduceMean_Op<DIM>::staticGetAttrsName)
.def("get_inputs_name", &ReduceMean_Op::getInputsName)
.def("get_outputs_name", &ReduceMean_Op::getOutputsName)
.def("attributes_name", &ReduceMean_Op::staticGetAttrsName)
;
declare_registrable<ReduceMean_Op<DIM>>(m, pyClassName);
declare_registrable<ReduceMean_Op>(m, pyClassName);
m.def(("ReduceMean" + std::to_string(DIM) + "D").c_str(), [](const std::vector<int>& axes,
m.def("ReduceMean", [](const std::vector<int>& axes,
DimSize_t keepDims,
const std::string& name) {
AIDGE_ASSERT(axes.size() == DIM, "axes size [{}] does not match DIM [{}]", axes.size(), DIM);
// AIDGE_ASSERT(axes.size() == DIM, "axes size [{}] does not match DIM [{}]", axes.size(), DIM);
return ReduceMean<DIM>(to_array<DIM>(axes.begin()), keepDims, name);
return ReduceMean(axes, keepDims, name);
}, py::arg("axes"),
py::arg("keep_dims") = 1,
py::arg("name") = "");
......@@ -46,9 +47,9 @@ template <DimIdx_t DIM> void declare_ReduceMeanOp(py::module &m) {
void init_ReduceMean(py::module &m) {
declare_ReduceMeanOp<1>(m);
declare_ReduceMeanOp<2>(m);
declare_ReduceMeanOp<3>(m);
declare_ReduceMeanOp(m);
// declare_ReduceMeanOp<2>(m);
// declare_ReduceMeanOp<3>(m);
// FIXME:
// m.def("ReduceMean1D", static_cast<NodeAPI(*)(const char*, int, int, int const
......
......@@ -11,6 +11,7 @@
#include <pybind11/pybind11.h>
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/Reshape.hpp"
#include "aidge/operator/OperatorTensor.hpp"
......
......@@ -11,6 +11,7 @@
#include <pybind11/pybind11.h>
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/Sigmoid.hpp"
#include "aidge/operator/OperatorTensor.hpp"
......
......@@ -11,6 +11,7 @@
#include <pybind11/pybind11.h>
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/Slice.hpp"
#include "aidge/operator/OperatorTensor.hpp"
......
......@@ -12,6 +12,7 @@
#include <pybind11/pybind11.h>
#include <string>
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/Softmax.hpp"
#include "aidge/operator/OperatorTensor.hpp"
......
......@@ -11,6 +11,7 @@
#include <pybind11/pybind11.h>
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/Sqrt.hpp"
#include "aidge/operator/OperatorTensor.hpp"
......
......@@ -11,6 +11,7 @@
#include <pybind11/pybind11.h>
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/Sub.hpp"
#include "aidge/operator/OperatorTensor.hpp"
......
......@@ -11,6 +11,7 @@
#include <pybind11/pybind11.h>
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/Tanh.hpp"
#include "aidge/operator/OperatorTensor.hpp"
......
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