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

Remove 'Tensor' object include from GlobalAvgPool_Op and move setBackend...

Remove 'Tensor' object include from GlobalAvgPool_Op and move setBackend member function from header to source file
parent a95891f2
No related branches found
No related tags found
2 merge requests!105version 0.2.0,!91Feat/operator global average pooling
Pipeline #42561 failed
......@@ -17,8 +17,6 @@
#include <vector>
#include "aidge/backend/OperatorImpl.hpp"
#include "aidge/data/Data.hpp"
#include "aidge/data/Tensor.hpp"
#include "aidge/graph/Node.hpp"
#include "aidge/operator/OperatorTensor.hpp"
#include "aidge/utils/Registrar.hpp"
......@@ -43,9 +41,9 @@ public:
GlobalAveragePooling_Op(const GlobalAveragePooling_Op &op)
: OperatorTensor(op) {
if (op.mImpl){
SET_IMPL_MACRO(GlobalAveragePooling_Op, *this, op.mOutputs[0]->getImpl()->backend());
}else{
if (op.mImpl) {
SET_IMPL_MACRO(GlobalAveragePooling_Op, *this, op.backend());
} else {
mImpl = nullptr;
}
}
......@@ -56,10 +54,7 @@ public:
void computeOutputDims() override final;
void setBackend(const std::string &name, DeviceIdx_t device = 0) override {
SET_IMPL_MACRO(GlobalAveragePooling_Op, *this, name);
mOutputs[0]->setBackend(name, device);
}
void setBackend(const std::string &name, DeviceIdx_t device = 0) override final;
static const std::vector<std::string> getInputsName() {
return {"data_input"};
......
......@@ -40,3 +40,8 @@ void Aidge::GlobalAveragePooling_Op::computeOutputDims() {
mOutputs[0]->resize(out_dims);
}
}
void Aidge::GlobalAveragePooling_Op::setBackend(const std::string &name, DeviceIdx_t device) {
SET_IMPL_MACRO(GlobalAveragePooling_Op, *this, name);
mOutputs[0]->setBackend(name, device);
}
\ No newline at end of file
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