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

Add some cocumentation to ReLU

parent 9bfe76ba
No related branches found
No related tags found
3 merge requests!279v0.4.0,!253v0.4.0,!163Export refactor
...@@ -25,16 +25,34 @@ ...@@ -25,16 +25,34 @@
namespace Aidge { 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: public:
static const std::string Type; static const std::string Type;
ReLU_Op() : OperatorTensor(Type, {InputCategory::Data}, 1) {} 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). * @brief Copy-constructor.
* @param op Operator to copy. * @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); ReLU_Op(const ReLU_Op& op);
......
...@@ -42,10 +42,14 @@ public: ...@@ -42,10 +42,14 @@ public:
*/ */
virtual Elts_t getNbRequiredData(const IOIndex_t inputIdx) const; 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; 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; virtual Elts_t getRequiredMemory(const IOIndex_t outputIdx, const std::vector<DimSize_t> &inputsSize) const;
/** /**
......
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