From b1e208fff0ad3eda4a146df3a5960d54cb9f96e4 Mon Sep 17 00:00:00 2001 From: NAUD Maxence <maxence.naud@cea.fr> Date: Sat, 19 Oct 2024 20:58:30 +0000 Subject: [PATCH] Add some cocumentation to ReLU --- include/aidge/operator/ReLU.hpp | 26 ++++++++++++++++++++++---- include/aidge/scheduler/ProdConso.hpp | 8 ++++++-- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/include/aidge/operator/ReLU.hpp b/include/aidge/operator/ReLU.hpp index 9b264c1d3..a9a84a3ee 100644 --- a/include/aidge/operator/ReLU.hpp +++ b/include/aidge/operator/ReLU.hpp @@ -25,16 +25,34 @@ namespace Aidge { -class ReLU_Op : public OperatorTensor, - public Registrable<ReLU_Op, std::string, std::function<std::shared_ptr<OperatorImpl>(const ReLU_Op&)>> { +/** + * @brief Description of an element-wise Rectified Linear Unit (ReLU) operation + * on an input Tensor. + * + * For each element x in the input, the function is defined as: + * `f(x) = max(0, x)` + * + * The input and output Tensors have the same dimensions. + * + * @see OperatorTensor + * @see Registrable + */ +class ReLU_Op : + public OperatorTensor, + public Registrable<ReLU_Op, // <Op, backend, implementation creation function> + std::string, + std::function<std::shared_ptr<OperatorImpl>(const ReLU_Op&)>> +{ public: static const std::string Type; ReLU_Op() : OperatorTensor(Type, {InputCategory::Data}, 1) {} /** - * @brief Copy-constructor. Copy the operator attributes and its output tensor(s), but not its input tensors (the new operator has no input associated). - * @param op Operator to copy. + * @brief Copy-constructor. + * @param op ReLU_Op to copy. + * @details Copies the operator attributes and its output tensor(s), but not + * its input tensors. The new operator has no associated input. */ ReLU_Op(const ReLU_Op& op); diff --git a/include/aidge/scheduler/ProdConso.hpp b/include/aidge/scheduler/ProdConso.hpp index a7c0ed5ae..fce8d7f65 100644 --- a/include/aidge/scheduler/ProdConso.hpp +++ b/include/aidge/scheduler/ProdConso.hpp @@ -42,10 +42,14 @@ public: */ virtual Elts_t getNbRequiredData(const IOIndex_t inputIdx) const; - // Amount of input data that cannot be overwritten during the execution. + /** + * @brief Amount of input data that cannot be overwritten during the execution. + */ virtual Elts_t getNbRequiredProtected(const IOIndex_t inputIdx) const; - // Memory required at an output for a given input size. + /** + * @brief Memory required at an output for a given input size. + */ virtual Elts_t getRequiredMemory(const IOIndex_t outputIdx, const std::vector<DimSize_t> &inputsSize) const; /** -- GitLab