21.02
|
Basic function to compute a SoftmaxLayer and a Log SoftmaxLayer. More...
#include <NESoftmaxLayer.h>
Public Member Functions | |
NESoftmaxLayerGeneric (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Constructor. More... | |
NESoftmaxLayerGeneric (const NESoftmaxLayerGeneric &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NESoftmaxLayerGeneric (NESoftmaxLayerGeneric &&) | |
Default move constructor. More... | |
NESoftmaxLayerGeneric & | operator= (const NESoftmaxLayerGeneric &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NESoftmaxLayerGeneric & | operator= (NESoftmaxLayerGeneric &&) |
Default move assignment operator. More... | |
~NESoftmaxLayerGeneric () | |
Default destructor. More... | |
void | configure (ITensor *input, ITensor *output, float beta=1.0f, int32_t axis=0) |
Set the input and output tensors. 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 *input, const ITensorInfo *output, float beta=1.0f, int32_t axis=0) |
Static function to check if given info will lead to a valid configuration of NESoftmaxLayer. More... | |
Basic function to compute a SoftmaxLayer and a Log SoftmaxLayer.
Definition at line 38 of file NESoftmaxLayer.h.
NESoftmaxLayerGeneric | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Constructor.
Definition at line 46 of file NESoftmaxLayer.cpp.
References NESoftmaxLayerGeneric< IS_LOG >::operator=(), and NESoftmaxLayerGeneric< IS_LOG >::~NESoftmaxLayerGeneric().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move constructor.
|
default |
Default destructor.
Referenced by NESoftmaxLayerGeneric< IS_LOG >::NESoftmaxLayerGeneric().
Set the input and output tensors.
[in,out] | input | Source tensor. Data types supported: QASYMM8/QASYMM8_SIGNED/F16/F32. If the width is not a multiple of the internal processing block size, NEFillBorder replicates the last value of each row to the nearest multiple. |
[out] | output | Destination tensor. Data types supported: same as input . |
[in] | beta | (Optional) A scaling factor for the exponent. |
[in] | axis | (Optional) The dimension in which to apply the function. E.g. for input of shape 4x5x6 and axis=1, softmax will be applied to 4x6=24 vectors of size 5. Defaults to 0 |
Definition at line 59 of file NESoftmaxLayer.cpp.
References ARM_COMPUTE_ERROR_ON_NULLPTR, ICloneable< T >::clone(), TensorInfo::clone(), ITensorInfo::data_type(), arm_compute::F32, arm_compute::softmax_helpers::get_permutation_vector_from_softmax_axis(), ITensor::info(), arm_compute::test::validation::input, arm_compute::test::validation::input_info, arm_compute::is_data_type_quantized_asymmetric(), MemoryGroup::manage(), ITensorInfo::num_dimensions(), TensorShape::set(), ITensorInfo::tensor_shape(), and arm_compute::wrap_around().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
Referenced by NESoftmaxLayerGeneric< IS_LOG >::NESoftmaxLayerGeneric().
|
default |
Default move assignment operator.
|
overridevirtual |
Run the kernels contained in the function.
For Neon kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 137 of file NESoftmaxLayer.cpp.
References arm_compute::ACL_DST, arm_compute::ACL_INT_0, arm_compute::ACL_INT_1, arm_compute::ACL_INT_2, arm_compute::ACL_INT_3, arm_compute::ACL_SRC, and ITensorPack::add_tensor().
|
static |
Static function to check if given info will lead to a valid configuration of NESoftmaxLayer.
[in] | input | Source tensor info. Data types supported: QASYMM8/QASYMM8_SIGNED/F16/F32. |
[in] | output | Destination tensor info. Data types supported: same as input |
[in] | beta | (Optional) A scaling factor for the exponent. |
[in] | axis | (Optional) The dimension in which to apply the function. E.g. for input of shape 4x5x6 and axis=1, softmax will be applied to 4x6=24 vectors of size 5. Defaults to 0 |
Definition at line 129 of file NESoftmaxLayer.cpp.
References ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR, and ARM_COMPUTE_RETURN_ON_ERROR.
Referenced by arm_compute::test::validation::DATA_TEST_CASE().