24.02.1
|
Basic function to run CLRNNLayer. More...
#include <CLRNNLayer.h>
Public Member Functions | |
CLRNNLayer (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Default constructor. More... | |
CLRNNLayer (const CLRNNLayer &)=delete | |
Prevent instances of this class from being copied. More... | |
CLRNNLayer & | operator= (const CLRNNLayer &)=delete |
Prevent instances of this class from being copied. More... | |
~CLRNNLayer () | |
Default destructor. More... | |
void | configure (const ICLTensor *input, const ICLTensor *weights, const ICLTensor *recurrent_weights, const ICLTensor *bias, ICLTensor *hidden_state, ICLTensor *output, ActivationLayerInfo &info) |
Initialize the function. More... | |
void | configure (const CLCompileContext &compile_context, const ICLTensor *input, const ICLTensor *weights, const ICLTensor *recurrent_weights, const ICLTensor *bias, ICLTensor *hidden_state, ICLTensor *output, ActivationLayerInfo &info) |
Initialize the function. More... | |
void | run () override |
Run the kernels contained in the function. More... | |
void | prepare () override |
Prepare the function for executing. More... | |
Public Member Functions inherited from IFunction | |
virtual | ~IFunction ()=default |
Destructor. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *recurrent_weights, const ITensorInfo *bias, const ITensorInfo *hidden_state, const ITensorInfo *output, const ActivationLayerInfo &info) |
Initialize the function. More... | |
Basic function to run CLRNNLayer.
Definition at line 41 of file CLRNNLayer.h.
CLRNNLayer | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Default constructor.
Definition at line 39 of file CLRNNLayer.cpp.
|
delete |
Prevent instances of this class from being copied.
|
default |
Default destructor.
void configure | ( | const CLCompileContext & | compile_context, |
const ICLTensor * | input, | ||
const ICLTensor * | weights, | ||
const ICLTensor * | recurrent_weights, | ||
const ICLTensor * | bias, | ||
ICLTensor * | hidden_state, | ||
ICLTensor * | output, | ||
ActivationLayerInfo & | info | ||
) |
Initialize the function.
[in] | compile_context | The compile context to be used. |
[in] | input | Input is a 2-D tensor of shape [input_size, batch_size]. Data types supported: F16/F32 |
[in] | weights | Weights tensor of shape [input_size, num_units] that multiplies the input. Data types supported: Same as input |
[in] | recurrent_weights | Weights tensor of shape [num_units, num_units] that multiplies the current 'state'. Data types supported: Same as input |
[in] | bias | Bias vector of shape [num_units]. Data types supported: Same as input |
[out] | output | Output tensor of shape [num_units, batch_size]. Data types supported: Same as input |
[in,out] | hidden_state | Output tensor of shape [num_units, batch_size]. Data types supported: Same as input |
[in] | info | Activation layer parameter. |
Definition at line 103 of file CLRNNLayer.cpp.
References CLTensorAllocator::allocate(), CLTensor::allocator(), ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, ARM_COMPUTE_LOG_PARAMS, bias, arm_compute::misc::shape_calculator::compute_rnn_shape(), CLCopy::configure(), CLActivationLayer::configure(), CLArithmeticAddition::configure(), CLFullyConnectedLayer::configure(), CLGEMM::configure(), ITensorInfo::dimension(), arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, arm_compute::test::validation::idx_height, ITensor::info(), arm_compute::test::validation::info, ITensorAllocator::init(), arm_compute::test::validation::input, MemoryGroup::manage(), arm_compute::SATURATE, arm_compute::test::validation::shape, and CLRNNLayer::validate().
void configure | ( | const ICLTensor * | input, |
const ICLTensor * | weights, | ||
const ICLTensor * | recurrent_weights, | ||
const ICLTensor * | bias, | ||
ICLTensor * | hidden_state, | ||
ICLTensor * | output, | ||
ActivationLayerInfo & | info | ||
) |
Initialize the function.
Valid data layouts:
Valid data type configurations:
src0 | src1 | src2 | src3 | dst0 | dst1 |
---|---|---|---|---|---|
F16 | F16 | F16 | F16 | F16 | F16 |
F32 | F32 | F32 | F32 | F32 | F32 |
[in] | input | Input is a 2-D tensor of shape [input_size, batch_size]. Data types supported: F16/F32 |
[in] | weights | Weights tensor of shape [input_size, num_units] that multiplies the input. Data types supported: Same as input |
[in] | recurrent_weights | Weights tensor of shape [num_units, num_units] that multiplies the current 'state'. Data types supported: Same as input |
[in] | bias | Bias vector of shape [num_units]. Data types supported: Same as input |
[out] | output | Output tensor of shape [num_units, batch_size]. Data types supported: Same as input |
[in,out] | hidden_state | Output tensor of shape [num_units, batch_size]. Data types supported: Same as input |
[in] | info | Activation layer parameter. |
Definition at line 91 of file CLRNNLayer.cpp.
References bias, CLKernelLibrary::get(), arm_compute::test::validation::info, and arm_compute::test::validation::input.
|
delete |
Prevent instances of this class from being copied.
|
overridevirtual |
Prepare the function for executing.
Any one off pre-processing step required by the function is handled here
Reimplemented from IFunction.
Definition at line 161 of file CLRNNLayer.cpp.
References CLFullyConnectedLayer::prepare(), and CLGEMM::prepare().
Referenced by CLRNNLayer::run().
|
overridevirtual |
Run the kernels contained in the function.
For CPU kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 146 of file CLRNNLayer.cpp.
References CLRNNLayer::prepare(), CLCopy::run(), CLActivationLayer::run(), CLFullyConnectedLayer::run(), CLGEMM::run(), and CLArithmeticAddition::run().
|
static |
Initialize the function.
[in] | input | Input is a 2-D tensor of shape [input_size, batch_size]. Data types supported: F16/F32 |
[in] | weights | Weights tensor of shape [input_size, num_units] that multiplies the input. Data types supported: Same as input |
[in] | recurrent_weights | Weights tensor of shape [num_units, num_units] that multiplies the current 'state'. Data types supported: Same as input |
[in] | bias | Bias vector of shape [num_units]. Data types supported: Same as input |
[in] | output | Output tensor of shape [num_units, batch_size]. Data types supported: Same as input |
[in] | hidden_state | Output tensor of shape [num_units, batch_size]. Data types supported: Same as input |
[in] | info | Activation layer parameter. |
Definition at line 55 of file CLRNNLayer.cpp.
References ARM_COMPUTE_RETURN_ERROR_ON, ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_NOT_IN, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS, ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR, ARM_COMPUTE_RETURN_ON_ERROR, bias, arm_compute::misc::shape_calculator::compute_rnn_shape(), ITensorInfo::dimension(), arm_compute::F16, arm_compute::F32, arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, arm_compute::test::validation::idx_height, arm_compute::test::validation::idx_width, arm_compute::test::validation::info, arm_compute::test::validation::input, arm_compute::SATURATE, ITensorInfo::tensor_shape(), CLActivationLayer::validate(), CLFullyConnectedLayer::validate(), CLGEMM::validate(), CLArithmeticAddition::validate(), and arm_compute::WIDTH.
Referenced by CLRNNLayer::configure().