Compute Library
18.05
|
Basic function to compute a SoftmaxLayer. More...
#include <CLSoftmaxLayer.h>
Public Member Functions | |
CLSoftmaxLayer (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Constructor. More... | |
void | configure (const ICLTensor *input, ICLTensor *output, float beta=1.0f) |
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) |
Static function to check if given info will lead to a valid configuration of CLSoftmaxLayer. More... | |
Basic function to compute a SoftmaxLayer.
Softmax is calculated by :
\[ out = exp((x - max(x)) * beta) / sum(exp((x - max(x)) * beta)) \]
This function runs the following kernels:
Definition at line 49 of file CLSoftmaxLayer.h.
CLSoftmaxLayer | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Constructor.
Set the input and output tensors.
[in] | input | Source tensor. Data types supported: QS8/QASYMM8/QS16/F16/F32 |
[out] | output | Destination tensor. Data types supported: same as input |
[in] | beta | (Optional) A scaling factor for the exponent. Defaults to 1.f |
Referenced by arm_compute::test::validation::DATA_TEST_CASE().
|
overridevirtual |
Run the kernels contained in the function.
For NEON kernels:
For OpenCL kernels:
Implements IFunction.
|
static |
Static function to check if given info will lead to a valid configuration of CLSoftmaxLayer.
[in] | input | Source tensor. Data types supported: QS8/QASYMM8/QS16/F16/F32 |
[in] | output | Destination tensor. Data types supported: same as input |
Referenced by arm_compute::test::validation::DATA_TEST_CASE().