diff --git a/include/aidge/operator/Flatten.hpp b/include/aidge/operator/Flatten.hpp index 0ccc54eb770421dd726658dfbd4e44ee78f28cfb..7493b25d76c0960996dc8ca15147351a06259c5a 100644 --- a/include/aidge/operator/Flatten.hpp +++ b/include/aidge/operator/Flatten.hpp @@ -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. */ diff --git a/include/aidge/operator/Identity.hpp b/include/aidge/operator/Identity.hpp index 24476f231806bf38ae48b9e2d5ec405e072afdb2..b1849cbc5385687d554537eb9a46e0437241e65a 100644 --- a/include/aidge/operator/Identity.hpp +++ b/include/aidge/operator/Identity.hpp @@ -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; }; diff --git a/include/aidge/operator/Reshape.hpp b/include/aidge/operator/Reshape.hpp index f02dae45e8285e7187ca7f739c163e69bee7c81c..c8ac87b6f28120d9a99b05212532b1ee25c14b6c 100644 --- a/include/aidge/operator/Reshape.hpp +++ b/include/aidge/operator/Reshape.hpp @@ -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. */ diff --git a/include/aidge/operator/Squeeze.hpp b/include/aidge/operator/Squeeze.hpp index 987f1e6af1452d9513cd855e63a8f8504721e25a..ed0f6d36674300da200db958b418ee6ea4762b05 100644 --- a/include/aidge/operator/Squeeze.hpp +++ b/include/aidge/operator/Squeeze.hpp @@ -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 diff --git a/include/aidge/operator/Unsqueeze.hpp b/include/aidge/operator/Unsqueeze.hpp index 5975ff0578ee89a50e1871b71f77846cb63c9d4d..8d95f5cddc57a152a0fd6539f59aefddc546a483 100644 --- a/include/aidge/operator/Unsqueeze.hpp +++ b/include/aidge/operator/Unsqueeze.hpp @@ -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