From 94c530bbe6f7d5bfdfd22d028cf04447ecde7a63 Mon Sep 17 00:00:00 2001 From: NAUD Maxence <maxence.naud@cea.fr> Date: Wed, 10 Jul 2024 15:10:49 +0000 Subject: [PATCH] add helper function definition and change param names to snake_case --- include/aidge/operator/DepthToSpace.hpp | 8 +++++--- src/operator/DepthToSpace.cpp | 11 +++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/include/aidge/operator/DepthToSpace.hpp b/include/aidge/operator/DepthToSpace.hpp index 05d2b2e07..bca88db7e 100644 --- a/include/aidge/operator/DepthToSpace.hpp +++ b/include/aidge/operator/DepthToSpace.hpp @@ -97,15 +97,17 @@ public: } }; -std::shared_ptr<Node> DepthToSpace(const std::uint32_t blockSize, +inline std::shared_ptr<Node> DepthToSpace(const std::uint32_t blockSize, const DepthToSpace_Op::Mode mode = DepthToSpace_Op::Mode::CRD, - const std::string& name = ""); + const std::string& name = "") { + return std::make_shared<Node>(std::make_shared<DepthToSpace_Op>(blockSize, mode), name); +} } // namespace Aidge namespace { template <> -const char *const EnumStrings<Aidge::DepthToSpaceAttr>::data[] = { "BlockSize", "Mode" }; +const char *const EnumStrings<Aidge::DepthToSpaceAttr>::data[] = { "block_size", "mode" }; } #endif //AIDGE_CORE_OPERATOR_DEPTHTOSPACE_H_ diff --git a/src/operator/DepthToSpace.cpp b/src/operator/DepthToSpace.cpp index 374e7a1c7..fa3d53fd3 100644 --- a/src/operator/DepthToSpace.cpp +++ b/src/operator/DepthToSpace.cpp @@ -57,6 +57,17 @@ void Aidge::DepthToSpace_OpImpl::forward() { const std::string Aidge::DepthToSpace_Op::Type = "DepthToSpace"; +Aidge::DepthToSpace_Op::DepthToSpace_Op(const DepthToSpace_Op& op) + : OperatorTensor(op), + mAttributes(op.mAttributes) +{ + if (op.mImpl) { + SET_IMPL_MACRO(DepthToSpace_Op, *this, op.backend()); + } else { + mImpl = nullptr; + } +} + bool Aidge::DepthToSpace_Op::forwardDims(bool /*allowDataDependency*/) { if (inputsAssociated()) { -- GitLab