Skip to content
Snippets Groups Projects
Commit 355863bb authored by Olivier BICHLER's avatar Olivier BICHLER
Browse files

Specify in-place operators

parent 6b6e4626
No related branches found
No related tags found
3 merge requests!414Update version 0.5.1 -> 0.6.0,!408[Add] Dropout Operator,!367Specify in-place operators
Pipeline #67917 passed
......@@ -38,6 +38,10 @@ public:
*/
Flatten_OpImpl(const Operator& op, const std::string& backend = ""): OperatorImpl(op, backend) {}
std::shared_ptr<ProdConso> getProdConso() const override {
return std::make_shared<ProdConso>(mOp, true); // Flatten is an in-place operation!
}
/**
* @brief Compute the forward pass of the Flatten operation.
*/
......
......@@ -29,6 +29,11 @@ namespace Aidge {
class Identity_OpImpl : public OperatorImpl {
public:
Identity_OpImpl(const Operator& op, const std::string& backend = ""): OperatorImpl(op, backend) {}
std::shared_ptr<ProdConso> getProdConso() const override {
return std::make_shared<ProdConso>(mOp, true); // Identity is an in-place operation!
}
void forward() override;
};
......
......@@ -37,6 +37,10 @@ public:
Reshape_OpImpl(const Operator& op, const std::string& backend = "")
: OperatorImpl(op, backend) {}
std::shared_ptr<ProdConso> getProdConso() const override {
return std::make_shared<ProdConso>(mOp, true); // Reshape is an in-place operation!
}
/**
* @brief Perform the forward operation for the reshape.
*/
......
......@@ -38,6 +38,11 @@ class Squeeze_OpImpl : public OperatorImpl {
public:
Squeeze_OpImpl(const Operator &op, const std::string &backend = "")
: OperatorImpl(op, backend) {}
std::shared_ptr<ProdConso> getProdConso() const override {
return std::make_shared<ProdConso>(mOp, true); // Squeeze is an in-place operation!
}
void forward() override;
};
} // namespace Aidge
......
......@@ -35,6 +35,11 @@ class Unsqueeze_OpImpl : public OperatorImpl {
public:
Unsqueeze_OpImpl(const Operator &op, const std::string &backend = "")
: OperatorImpl(op, backend) {}
std::shared_ptr<ProdConso> getProdConso() const override {
return std::make_shared<ProdConso>(mOp, true); // Unsqueeze is an in-place operation!
}
void forward() override;
};
} // namespace Aidge
......
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