24.02.1
|
Function to compute Add+Mul+Add fused operation. More...
#include <NEAddMulAdd.h>
Public Member Functions | |
NEAddMulAdd (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Constructor. More... | |
NEAddMulAdd (const NEAddMulAdd &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEAddMulAdd (NEAddMulAdd &&)=delete | |
Prevent instances of this class from being moved (As this class contains non movable objects) More... | |
NEAddMulAdd & | operator= (const NEAddMulAdd &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEAddMulAdd & | operator= (NEAddMulAdd &&)=delete |
Prevent instances of this class from being moved (As this class contains non movable objects) More... | |
~NEAddMulAdd () | |
Destructor. More... | |
void | configure (ITensor *input1, ITensor *input2, ITensor *bn_mul, ITensor *bn_add, ITensor *add_output, ITensor *final_output, ConvertPolicy policy, const ActivationLayerInfo &act_info) |
Initialize the function's inputs and outputs. More... | |
void | run () override |
Run the kernels contained in the function. More... | |
Public Member Functions inherited from IFunction | |
virtual | ~IFunction ()=default |
Destructor. More... | |
virtual void | prepare () |
Prepare the function for executing. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *bn_mul, const ITensorInfo *bn_add, const ITensorInfo *add_output, const ITensorInfo *final_output, ConvertPolicy policy, const ActivationLayerInfo &act_info) |
Static function to check if given info will lead to a valid configuration of NEAddMulAdd. More... | |
Function to compute Add+Mul+Add fused operation.
Definition at line 40 of file NEAddMulAdd.h.
NEAddMulAdd | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Constructor.
Definition at line 43 of file NEAddMulAdd.cpp.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
delete |
Prevent instances of this class from being moved (As this class contains non movable objects)
|
default |
Destructor.
void configure | ( | ITensor * | input1, |
ITensor * | input2, | ||
ITensor * | bn_mul, | ||
ITensor * | bn_add, | ||
ITensor * | add_output, | ||
ITensor * | final_output, | ||
ConvertPolicy | policy, | ||
const ActivationLayerInfo & | act_info | ||
) |
Initialize the function's inputs and outputs.
Valid data layouts:
Valid data type configurations:
input1 | input2 | bn_mul | bn_add | add_output | final_output |
---|---|---|---|---|---|
QASYMM8 | QASYMM8 | QASYMM8 | QASYMM8 | QASYMM8 | QASYMM8 |
QASYMM8_SIGNED | QASYMM8_SIGNED | QASYMM8_SIGNED | QASYMM8_SIGNED | QASYMM8_SIGNED | QASYMM8_SIGNED |
F16 | F16 | F16 | F16 | F16 | F16 |
F32 | F32 | F32 | F32 | F32 | F32 |
This is what this composite function (tailored for add followed by a batch norm operation) does: add_output <- input1 + input2 (add) final_output <- add_output * bn_mul + bn_add (batch norm = mul+add)
[in] | input1 | First tensor input. Data type supported: QASYMM8/QASYMM8_SIGNED/F16/F32. |
[in] | input2 | Second tensor input. Data types supported: Same as input . |
[in] | bn_mul | The multiplication coefficient on the feature dimension. Data types supported: Same as input . It's one dimensional tensor with size equal to the feature maps [FM] |
[in] | bn_add | The addition coefficient on the feature dimension. Data types supported: Same as input . It's one dimensional tensor with size equal to the feature maps [FM] |
[out] | add_output | Output of the first add. Data type supported: Same as input . |
[out] | final_output | Output of the add+mul+add+act composite operation. Data type supported: Same as input . |
[in] | policy | Policy to handle overflow |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. |
Definition at line 50 of file NEAddMulAdd.cpp.
References arm_compute::ACL_DST_0, arm_compute::ACL_DST_1, arm_compute::ACL_SRC_0, arm_compute::ACL_SRC_1, arm_compute::ACL_SRC_2, arm_compute::ACL_SRC_3, arm_compute::test::validation::act_info, ARM_COMPUTE_LOG_PARAMS, and ITensor::info().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
delete |
Prevent instances of this class from being moved (As this class contains non movable objects)
|
overridevirtual |
Run the kernels contained in the function.
For CPU kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 85 of file NEAddMulAdd.cpp.
|
static |
Static function to check if given info will lead to a valid configuration of NEAddMulAdd.
Similar to NEAddMulAdd::configure() except the arguments are ITensorInfo * instead of ITensor *
Definition at line 73 of file NEAddMulAdd.cpp.
References arm_compute::test::validation::act_info, and CpuAddMulAdd::validate().