21.02
|
Basic function to run NERNNLayer. More...
#include <NERNNLayer.h>
Public Member Functions | |
NERNNLayer (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Default constructor. More... | |
NERNNLayer (const NERNNLayer &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NERNNLayer (NERNNLayer &&)=delete | |
Prevent instances of this class from being moved (As this class contains pointers) More... | |
NERNNLayer & | operator= (const NERNNLayer &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NERNNLayer & | operator= (NERNNLayer &&)=delete |
Prevent instances of this class from being moved (As this class contains pointers) More... | |
~NERNNLayer () | |
Default destructor. More... | |
void | configure (const ITensor *input, const ITensor *weights, const ITensor *recurrent_weights, const ITensor *bias, ITensor *hidden_state, ITensor *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 NERNNLayer.
Definition at line 40 of file NERNNLayer.h.
NERNNLayer | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Default constructor.
Definition at line 48 of file NERNNLayer.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 pointers)
|
default |
Default destructor.
void configure | ( | const ITensor * | input, |
const ITensor * | weights, | ||
const ITensor * | recurrent_weights, | ||
const ITensor * | bias, | ||
ITensor * | hidden_state, | ||
ITensor * | output, | ||
ActivationLayerInfo & | info | ||
) |
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 |
[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 81 of file NERNNLayer.cpp.
References TensorAllocator::allocate(), Tensor::allocator(), ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::misc::shape_calculator::compute_rnn_shape(), NECopy::configure(), NEActivationLayer::configure(), NEArithmeticAddition::configure(), NEGEMM::configure(), NEFullyConnectedLayer::configure(), ITensorInfo::data_layout(), ITensorInfo::data_type(), 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, TensorAllocator::init(), MemoryGroup::manage(), arm_compute::SATURATE, arm_compute::test::validation::shape, and NERNNLayer::validate().
|
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 pointers)
|
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 134 of file NERNNLayer.cpp.
References NEGEMM::prepare(), and NEFullyConnectedLayer::prepare().
Referenced by NERNNLayer::run().
|
overridevirtual |
Run the kernels contained in the function.
For Neon kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 117 of file NERNNLayer.cpp.
References NERNNLayer::prepare(), NECopy::run(), NEActivationLayer::run(), NEArithmeticAddition::run(), NEGEMM::run(), and NEFullyConnectedLayer::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 54 of file NERNNLayer.cpp.
References ARM_COMPUTE_RETURN_ERROR_ON, ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_NOT_IN, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS, ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR, ARM_COMPUTE_RETURN_ON_ERROR, arm_compute::misc::shape_calculator::compute_rnn_shape(), ITensorInfo::data_layout(), ITensorInfo::data_type(), 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, ITensorInfo::num_dimensions(), arm_compute::SATURATE, ITensorInfo::tensor_shape(), NEActivationLayer::validate(), NEArithmeticAddition::validate(), NEFullyConnectedLayer::validate(), and arm_compute::WIDTH.
Referenced by NERNNLayer::configure(), and arm_compute::test::validation::DATA_TEST_CASE().