24.02.1
|
Basic function to run NELSTMLayerQuantized.
More...
#include <NELSTMLayerQuantized.h>
|
| NELSTMLayerQuantized (std::shared_ptr< IMemoryManager > memory_manager=nullptr) |
| Default constructor. More...
|
|
| NELSTMLayerQuantized (const NELSTMLayerQuantized &)=delete |
| Prevent instances of this class from being copied (As this class contains pointers) More...
|
|
| NELSTMLayerQuantized (NELSTMLayerQuantized &&)=delete |
| Prevent instances of this class from being moved (As this class contains pointers) More...
|
|
NELSTMLayerQuantized & | operator= (const NELSTMLayerQuantized &)=delete |
| Prevent instances of this class from being copied (As this class contains pointers) More...
|
|
NELSTMLayerQuantized & | operator= (NELSTMLayerQuantized &&)=delete |
| Prevent instances of this class from being moved (As this class contains pointers) More...
|
|
| ~NELSTMLayerQuantized () |
| Default destructor. More...
|
|
void | configure (const ITensor *input, const ITensor *input_to_input_weights, const ITensor *input_to_forget_weights, const ITensor *input_to_cell_weights, const ITensor *input_to_output_weights, const ITensor *recurrent_to_input_weights, const ITensor *recurrent_to_forget_weights, const ITensor *recurrent_to_cell_weights, const ITensor *recurrent_to_output_weights, const ITensor *input_gate_bias, const ITensor *forget_gate_bias, const ITensor *cell_bias, const ITensor *output_gate_bias, ITensor *cell_state_in, const ITensor *output_state_in, ITensor *cell_state_out, ITensor *output_state_out) |
| Initialize function's tensors. More...
|
|
void | run () override |
| Run the kernels contained in the function. More...
|
|
void | prepare () override |
| Prepare the function for executing. More...
|
|
virtual | ~IFunction ()=default |
| Destructor. More...
|
|
|
static Status | validate (const ITensorInfo *input, const ITensorInfo *input_to_input_weights, const ITensorInfo *input_to_forget_weights, const ITensorInfo *input_to_cell_weights, const ITensorInfo *input_to_output_weights, const ITensorInfo *recurrent_to_input_weights, const ITensorInfo *recurrent_to_forget_weights, const ITensorInfo *recurrent_to_cell_weights, const ITensorInfo *recurrent_to_output_weights, const ITensorInfo *input_gate_bias, const ITensorInfo *forget_gate_bias, const ITensorInfo *cell_bias, const ITensorInfo *output_gate_bias, const ITensorInfo *cell_state_in, const ITensorInfo *output_state_in, const ITensorInfo *cell_state_out, const ITensorInfo *output_state_out) |
| Static function to check if given info will lead to a valid configuration of NELSTMLayer. More...
|
|
Basic function to run NELSTMLayerQuantized.
This function calls the following functions/kernels:
- NEGEMMLowpMatrixMultiplyCore Quantized matrix multiplication core. Accumulators are 32-bit integers
- NEGEMMLowpOutputStage Convert 32-bit integers into QSYMM16
- NETranspose Matrix transpose
- NEConcatenateLayer Tensor concatenation
- NEActivationLayer Activation functions (tanh and logistic)
- NEArithmeticAddition Elementwise addition
- NEPixelWiseMultiplication Elementwise multiplication
- NESlice Tensor slicing
- NEDequantizationLayer Dequantize into float
- NEQuantizationLayer Quantize from float
Definition at line 62 of file NELSTMLayerQuantized.h.
◆ NELSTMLayerQuantized() [1/3]
Default constructor.
Definition at line 49 of file NELSTMLayerQuantized.cpp.
50 : _memory_group(std::move(memory_manager)),
54 _concat_input_weights(),
55 _concat_recurrent_weights(),
59 _sigmoid_forget_gate(),
60 _sigmoid_input_gate(),
61 _sigmoid_output_gate(),
62 _tanh_modulation_gate(),
69 _slice_input_tensor(),
70 _slice_forget_tensor(),
72 _slice_output_tensor(),
75 _input_to_input_weights(
nullptr),
76 _input_to_forget_weights(
nullptr),
77 _input_to_cell_weights(
nullptr),
78 _input_to_output_weights(
nullptr),
79 _recurrent_to_input_weights(
nullptr),
80 _recurrent_to_forget_weights(
nullptr),
81 _recurrent_to_cell_weights(
nullptr),
82 _recurrent_to_output_weights(
nullptr),
83 _input_gate_bias(
nullptr),
84 _forget_gate_bias(
nullptr),
86 _output_gate_bias(
nullptr),
91 _weights_transposed(),
98 _input_modulation_gate_input(),
99 _forget_gate_output(),
100 _input_gate_output(),
101 _output_gate_output(),
102 _input_modulation_gate_output(),
106 _output_state_out_symm(),
107 _output_state_out_f32(),
◆ NELSTMLayerQuantized() [2/3]
Prevent instances of this class from being copied (As this class contains pointers)
◆ NELSTMLayerQuantized() [3/3]
Prevent instances of this class from being moved (As this class contains pointers)
◆ ~NELSTMLayerQuantized()
◆ configure()
void configure |
( |
const ITensor * |
input, |
|
|
const ITensor * |
input_to_input_weights, |
|
|
const ITensor * |
input_to_forget_weights, |
|
|
const ITensor * |
input_to_cell_weights, |
|
|
const ITensor * |
input_to_output_weights, |
|
|
const ITensor * |
recurrent_to_input_weights, |
|
|
const ITensor * |
recurrent_to_forget_weights, |
|
|
const ITensor * |
recurrent_to_cell_weights, |
|
|
const ITensor * |
recurrent_to_output_weights, |
|
|
const ITensor * |
input_gate_bias, |
|
|
const ITensor * |
forget_gate_bias, |
|
|
const ITensor * |
cell_bias, |
|
|
const ITensor * |
output_gate_bias, |
|
|
ITensor * |
cell_state_in, |
|
|
const ITensor * |
output_state_in, |
|
|
ITensor * |
cell_state_out, |
|
|
ITensor * |
output_state_out |
|
) |
| |
Initialize function's tensors.
Valid data layouts:
Valid data type configurations:
src0 - src8 | src9 - src12 | src13 | src14 | dst0 | dst1 |
QASYMM8 | S32 | QSYMM16 | QASYMM8 | QSYMM16 | QASYMM8 |
- Parameters
-
[in] | input | Source tensor. Input is a 2D tensor with dimensions [input_size, batch_size]. Data types supported: QASYMM8. |
[in] | input_to_input_weights | 2D weights tensor with dimensions [input_size, output_size]. Data type supported: Same as input . |
[in] | input_to_forget_weights | 2D weights tensor with dimensions [input_size, output_size]. Data type supported: Same as input . |
[in] | input_to_cell_weights | 2D weights tensor with dimensions [input_size, output_size]. Data type supported: Same as input . |
[in] | input_to_output_weights | 2D weights tensor with dimensions [input_size, output_size]. Data type supported: Same as input . |
[in] | recurrent_to_input_weights | 2D weights tensor with dimensions [output_size, output_size]. Data type supported: Same as input . |
[in] | recurrent_to_forget_weights | 2D weights tensor with dimensions [output_size, output_size]. Data type supported: Same as input . |
[in] | recurrent_to_cell_weights | 2D weights tensor with dimensions [output_size, output_size]. Data type supported: Same as input . |
[in] | recurrent_to_output_weights | 2D weights tensor with dimensions [output_size, output_size]. Data type supported: Same as input . |
[in] | input_gate_bias | 1D weights tensor with dimensions [output_size]. Data type supported: S32. |
[in] | forget_gate_bias | 1D weights tensor with dimensions [output_size]. Data type supported: S32. |
[in] | cell_bias | 1D weights tensor with dimensions [output_size]. Data type supported: S32. |
[in] | output_gate_bias | 1D weights tensor with dimensions [output_size]. Data type supported: S32. |
[in] | cell_state_in | 2D tensor with dimensions [output_size, batch_size]. Data type supported: QSYMM16. |
[in] | output_state_in | 2D tensor with dimensions [output_size, batch_size]. Data type supported: Same as input . |
[out] | cell_state_out | Destination tensor. Output is a 2D tensor with dimensions [output_size, batch_size]. Data type supported: QSYMM16. |
[out] | output_state_out | Destination tensor. Output is a 2D tensor with dimensions [output_size, batch_size].Data types supported: Same as input . |
Definition at line 112 of file NELSTMLayerQuantized.cpp.
134 cell_state_out, output_state_out);
141 output_state_in->info(), cell_state_out->info(), output_state_out->info()));
146 cell_bias,
output_gate_bias, cell_state_in, output_state_in, cell_state_out,
150 const int batch_size =
input->info()->dimension(1);
170 _cell_bias = cell_bias;
187 std::vector<const ITensor *> weights_vector{&_recurrent_weights, &_input_weights};
191 _transpose_weights.
configure(&_weights, &_weights_transposed);
194 std::vector<const ITensor *> input_vector{
input, output_state_in};
195 _memory_group.
manage(&_input);
211 _memory_group.
manage(&_output_highp);
213 _gemmlowp.
configure(&_input, &_weights_transposed,
nullptr, &_output_highp);
225 int32_t output_multiplier = 0;
226 int32_t output_shift = 0;
229 _memory_group.
manage(&_output_lowp);
231 GEMMLowpOutputStageInfo
info;
233 info.gemmlowp_multiplier = output_multiplier;
234 info.gemmlowp_shift = output_shift;
236 _output_stage.
configure(&_output_highp, &_bias, &_output_lowp,
info);
243 _memory_group.
manage(&_input_gate_input);
244 _slice_input_tensor.
configure(&_output_lowp, &_input_gate_input, {0, 0}, {
output_size, batch_size});
245 _memory_group.
manage(&_forget_gate_input);
248 _memory_group.
manage(&_input_modulation_gate_input);
249 _slice_cell_tensor.
configure(&_output_lowp, &_input_modulation_gate_input, {2 *
output_size, 0},
251 _memory_group.
manage(&_output_gate_input);
258 _memory_group.
manage(&_input_gate_input);
260 _memory_group.
manage(&_forget_gate_input);
262 _memory_group.
manage(&_input_modulation_gate_input);
265 _memory_group.
manage(&_output_gate_input);
271 _memory_group.
manage(&_forget_gate_output);
274 _sigmoid_forget_gate.
configure(&_forget_gate_input, &_forget_gate_output,
275 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC));
279 _memory_group.
manage(&_input_gate_output);
282 _sigmoid_input_gate.
configure(&_input_gate_input, &_input_gate_output,
283 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC));
287 _memory_group.
manage(&_input_modulation_gate_output);
290 _tanh_modulation_gate.
configure(&_input_modulation_gate_input, &_input_modulation_gate_output,
291 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH, 1.0f, 1.0f));
295 _memory_group.
manage(&_output_gate_output);
298 _sigmoid_output_gate.
configure(&_output_gate_input, &_output_gate_output,
299 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC));
303 _memory_group.
manage(&_cell_state1);
310 _memory_group.
manage(&_cell_state2);
323 _memory_group.
manage(&_output_state_tmp);
325 TensorInfo(cell_state_out->info()->tensor_shape(), 1,
DataType::QSYMM16, qsymm_0));
326 _tanh_output_state.
configure(cell_state_out, &_output_state_tmp,
327 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH, 1.0f, 1.0f));
329 _memory_group.
manage(&_output_state_out_symm);
338 _memory_group.
manage(&_output_state_out_f32);
341 _dequantize.
configure(&_output_state_out_symm, &_output_state_out_f32);
344 _quantize.
configure(&_output_state_out_f32, output_state_out);
References TensorAllocator::allocate(), Tensor::allocator(), ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, ARM_COMPUTE_LOG_PARAMS, arm_compute::auto_init_if_empty(), arm_compute::quantization::calculate_quantized_multiplier(), NETranspose::configure(), NEQuantizationLayer::configure(), NEDequantizationLayer::configure(), NESlice::configure(), NEConcatenateLayer::configure(), NEArithmeticAddition::configure(), NEGEMMLowpOutputStage::configure(), NEActivationLayer::configure(), NEPixelWiseMultiplication::configure(), NEGEMMLowpMatrixMultiplyCore::configure(), Window::DimX, Window::DimY, arm_compute::F32, arm_compute::test::validation::forget_gate_bias, ITensor::info(), Tensor::info(), arm_compute::test::validation::info, TensorAllocator::init(), arm_compute::test::validation::input, arm_compute::test::validation::input_gate_bias, arm_compute::test::validation::input_size, arm_compute::test::validation::input_to_cell_weights, arm_compute::test::validation::input_to_forget_weights, arm_compute::test::validation::input_to_input_weights, arm_compute::test::validation::input_to_output_weights, MemoryGroup::manage(), UniformQuantizationInfo::offset, arm_compute::test::validation::output_gate_bias, arm_compute::test::validation::output_size, arm_compute::test::validation::qasymm(), arm_compute::QASYMM8, arm_compute::QSYMM16, arm_compute::test::validation::qsymm_3(), arm_compute::test::validation::qsymm_4(), arm_compute::QUANTIZE_DOWN_FIXEDPOINT, arm_compute::test::validation::qweights(), arm_compute::test::validation::recurrent_to_cell_weights, arm_compute::test::validation::recurrent_to_forget_weights, arm_compute::test::validation::recurrent_to_input_weights, arm_compute::test::validation::recurrent_to_output_weights, arm_compute::S32, arm_compute::SATURATE, UniformQuantizationInfo::scale, ITensorInfo::set_quantization_info(), ITensorInfo::tensor_shape(), arm_compute::TO_ZERO, QuantizationInfo::uniform(), and NELSTMLayerQuantized::validate().
◆ operator=() [1/2]
Prevent instances of this class from being copied (As this class contains pointers)
◆ operator=() [2/2]
Prevent instances of this class from being moved (As this class contains pointers)
◆ prepare()
◆ run()
◆ validate()
Status validate |
( |
const ITensorInfo * |
input, |
|
|
const ITensorInfo * |
input_to_input_weights, |
|
|
const ITensorInfo * |
input_to_forget_weights, |
|
|
const ITensorInfo * |
input_to_cell_weights, |
|
|
const ITensorInfo * |
input_to_output_weights, |
|
|
const ITensorInfo * |
recurrent_to_input_weights, |
|
|
const ITensorInfo * |
recurrent_to_forget_weights, |
|
|
const ITensorInfo * |
recurrent_to_cell_weights, |
|
|
const ITensorInfo * |
recurrent_to_output_weights, |
|
|
const ITensorInfo * |
input_gate_bias, |
|
|
const ITensorInfo * |
forget_gate_bias, |
|
|
const ITensorInfo * |
cell_bias, |
|
|
const ITensorInfo * |
output_gate_bias, |
|
|
const ITensorInfo * |
cell_state_in, |
|
|
const ITensorInfo * |
output_state_in, |
|
|
const ITensorInfo * |
cell_state_out, |
|
|
const ITensorInfo * |
output_state_out |
|
) |
| |
|
static |
Static function to check if given info will lead to a valid configuration of NELSTMLayer.
- Parameters
-
[in] | input | Source tensor info. Input is a 2D tensor info with dimensions [input_size, batch_size]. Data types supported: QASYMM8. |
[in] | input_to_input_weights | 2D weights tensor info with dimensions [input_size, output_size]. Data type supported: Same as input . |
[in] | input_to_forget_weights | 2D weights tensor info with dimensions [input_size, output_size]. Data type supported: Same as input . |
[in] | input_to_cell_weights | 2D weights tensor info with dimensions [input_size, output_size]. Data type supported: Same as input . |
[in] | input_to_output_weights | 2D weights tensor info with dimensions [input_size, output_size]. Data type supported: Same as input . |
[in] | recurrent_to_input_weights | 2D weights tensor info with dimensions [output_size, output_size]. Data type supported: Same as input . |
[in] | recurrent_to_forget_weights | 2D weights tensor info with dimensions [output_size, output_size]. Data type supported: Same as input . |
[in] | recurrent_to_cell_weights | 2D weights tensor info with dimensions [output_size, output_size]. Data type supported: Same as input . |
[in] | recurrent_to_output_weights | 2D weights tensor info with dimensions [output_size, output_size]. Data type supported: Same as input . |
[in] | input_gate_bias | 1D weights tensor info with dimensions [output_size]. Data type supported: S32. |
[in] | forget_gate_bias | 1D weights tensor info with dimensions [output_size]. Data type supported: S32. |
[in] | cell_bias | 1D weights tensor info with dimensions [output_size]. Data type supported: S32. |
[in] | output_gate_bias | 1D weights tensor info with dimensions [output_size]. Data type supported: S32. |
[in] | cell_state_in | 2D tensor info with dimensions [output_size, batch_size]. Data type supported: QSYMM16. |
[in] | output_state_in | 2D tensor info with dimensions [output_size, batch_size]. Data type supported: Same as input . |
[out] | cell_state_out | Destination tensor info. Output is a 2D tensor info with dimensions [output_size, batch_size]. Data type supported: QSYMM16. |
[out] | output_state_out | Destination tensor info. Output is a 2D tensor info with dimensions [output_size, batch_size].Data types supported: Same as input . |
- Returns
- a status
Definition at line 348 of file NELSTMLayerQuantized.cpp.
373 const int batch_size =
input->dimension(1);
388 TensorInfo bias_info(
390 TensorInfo output_state_info(cell_state_in->clone()
391 ->set_tensor_shape(TensorShape(
output_size, batch_size))
393 .set_quantization_info(
qasymm));
394 TensorInfo cell_state_info(cell_state_in->clone()
395 ->set_tensor_shape(TensorShape(
output_size, batch_size))
397 .set_quantization_info(
qsymm_4));
432 std::vector<const ITensorInfo *> inputs_weights_vector;
442 std::vector<const ITensorInfo *> recurrent_weights_vector;
452 std::vector<const ITensorInfo *> weights_vector;
453 weights_vector.emplace_back(&recurrent_weights);
454 weights_vector.emplace_back(&input_weights);
458 const TensorShape weights_transposed_shape(weights.tensor_shape()[1], weights.tensor_shape()[0]);
459 TensorInfo weights_transposed = weights.clone()->set_is_resizable(
true).set_tensor_shape(weights_transposed_shape);
463 std::vector<const ITensorInfo *> input_vector;
464 input_vector.emplace_back(
input);
465 input_vector.emplace_back(output_state_in);
470 std::vector<const ITensorInfo *> bias_vector;
473 bias_vector.emplace_back(cell_bias);
495 int32_t output_multiplier = 0;
496 int32_t output_shift = 0;
501 GEMMLowpOutputStageInfo
info;
503 info.gemmlowp_multiplier = output_multiplier;
504 info.gemmlowp_shift = output_shift;
508 TensorInfo input_gate_input;
509 TensorInfo forget_gate_input;
510 TensorInfo input_modulation_gate_input;
511 TensorInfo output_gate_input;
552 const TensorInfo forget_gate_output(forget_gate_input.tensor_shape(), 1,
DataType::QSYMM16, qsymm_0);
555 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC)));
557 const TensorInfo input_gate_output(input_gate_input.tensor_shape(), 1,
DataType::QSYMM16, qsymm_0);
559 &input_gate_input, &input_gate_output, ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC)));
561 const TensorInfo input_modulation_gate_output(input_modulation_gate_input.tensor_shape(), 1,
DataType::QSYMM16,
565 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH, 1.0f, 1.0f)));
567 const TensorInfo output_gate_output(output_gate_input.tensor_shape(), 1,
DataType::QSYMM16, qsymm_0);
570 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC)));
588 const TensorInfo output_state_tmp(cell_state_out->tensor_shape(), 1,
DataType::QSYMM16, qsymm_0);
591 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH, 1.0f, 1.0f)));
594 const TensorInfo output_state_out_symm(output_gate_output.tensor_shape(), 1,
DataType::QSYMM16, qsymm_0);
600 const TensorInfo output_state_out_f32(output_state_out_symm.tensor_shape(), 1,
DataType::F32);
606 if (cell_state_out->total_size() != 0)
613 if (output_state_out->total_size() != 0)
References ARM_COMPUTE_RETURN_ERROR_ON, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_QUANTIZATION_INFO, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES, ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR, ARM_COMPUTE_RETURN_ON_ERROR, arm_compute::quantization::calculate_quantized_multiplier(), ICloneable< T >::clone(), TensorInfo::clone(), Window::DimX, Window::DimY, arm_compute::F32, arm_compute::test::validation::forget_gate_bias, arm_compute::test::validation::info, arm_compute::test::validation::input, arm_compute::test::validation::input_gate_bias, arm_compute::test::validation::input_size, arm_compute::test::validation::input_to_cell_weights, arm_compute::test::validation::input_to_forget_weights, arm_compute::test::validation::input_to_input_weights, arm_compute::test::validation::input_to_output_weights, ITensorInfo::num_dimensions(), UniformQuantizationInfo::offset, arm_compute::test::validation::output_gate_bias, arm_compute::test::validation::output_size, arm_compute::test::validation::qasymm(), arm_compute::QASYMM8, arm_compute::QSYMM16, arm_compute::test::validation::qsymm_3(), arm_compute::test::validation::qsymm_4(), arm_compute::QUANTIZE_DOWN_FIXEDPOINT, arm_compute::test::validation::qweights(), arm_compute::test::validation::recurrent_to_cell_weights, arm_compute::test::validation::recurrent_to_forget_weights, arm_compute::test::validation::recurrent_to_input_weights, arm_compute::test::validation::recurrent_to_output_weights, arm_compute::S32, arm_compute::SATURATE, UniformQuantizationInfo::scale, TensorInfo::set_quantization_info(), ITensorInfo::tensor_shape(), TensorInfo::tensor_shape(), arm_compute::TO_ZERO, ITensorInfo::total_size(), QuantizationInfo::uniform(), NETranspose::validate(), NEQuantizationLayer::validate(), NEDequantizationLayer::validate(), NESlice::validate(), NEConcatenateLayer::validate(), NEGEMMLowpOutputStage::validate(), NEArithmeticAddition::validate(), NEActivationLayer::validate(), NEGEMMLowpMatrixMultiplyCore::validate(), and NEPixelWiseMultiplication::validate().
Referenced by NELSTMLayerQuantized::configure().
The documentation for this class was generated from the following files:
void configure(const ITensor *input1, const ITensor *input2, ITensor *output, ConvertPolicy policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel's inputs, output and conversion policy.
void configure(const ITensor *input, const ITensor *bias, ITensor *output, const GEMMLowpOutputStageInfo &info)
Initialise the kernel's inputs, output.
void run() override
Run the kernels contained in the function.
void manage(IMemoryManageable *obj) override
Sets a object to be managed by the given memory group.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
void init(const TensorAllocator &allocator, const Coordinates &coords, TensorInfo &sub_info)
Shares the same backing memory with another tensor allocator, while the tensor info might be differen...
static Status validate(const ITensorInfo *input, const ITensorInfo *output)
Static function to check if given info will lead to a valid configuration of NETranspose.
static Status validate(const ITensorInfo *a, const ITensorInfo *b, const ITensorInfo *c, const ITensorInfo *output, const GEMMInfo &gemm_info=GEMMInfo())
Static function to check if given info will lead to a valid configuration of NEGEMMLowpMatrixMultiply...
void configure(const ITensor *a, const ITensor *b, const ITensor *c, ITensor *output, const GEMMInfo &gemm_info=GEMMInfo())
Initialise the kernel's inputs, output.
void configure(std::vector< const ITensor * > inputs_vector, ITensor *output, size_t axis)
Initialise the kernel's inputs vector and output.
static Status validate(const ITensorInfo *input, const ITensorInfo *input_to_input_weights, const ITensorInfo *input_to_forget_weights, const ITensorInfo *input_to_cell_weights, const ITensorInfo *input_to_output_weights, const ITensorInfo *recurrent_to_input_weights, const ITensorInfo *recurrent_to_forget_weights, const ITensorInfo *recurrent_to_cell_weights, const ITensorInfo *recurrent_to_output_weights, const ITensorInfo *input_gate_bias, const ITensorInfo *forget_gate_bias, const ITensorInfo *cell_bias, const ITensorInfo *output_gate_bias, const ITensorInfo *cell_state_in, const ITensorInfo *output_state_in, const ITensorInfo *cell_state_out, const ITensorInfo *output_state_out)
Static function to check if given info will lead to a valid configuration of NELSTMLayer.
@ QASYMM8
quantized, asymmetric fixed-point 8-bit number unsigned
void run() override
Run the kernels contained in the function.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(...)
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
void run() override
Run the kernels contained in the function.
static Status validate(const ITensorInfo *input, const ITensorInfo *bias, const ITensorInfo *output, const GEMMLowpOutputStageInfo &info)
Static function to check if given info will lead to a valid configuration of NEGEMMLowpOutputStage.
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, float scale, ConvertPolicy overflow_policy, RoundingPolicy rounding_policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of NEPixelWiseMultiplicatio...
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
@ QSYMM16
quantized, symmetric fixed-point 16-bit number
void prepare() override
Prepare the function for executing.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const ActivationLayerInfo &act_info)
[NEActivationLayer snippet]
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const Coordinates &starts, const Coordinates &ends)
Static function to check if given info will lead to a valid configuration of NESlice.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
QuantizationInfo qweights(1.f/16.f, 16)
void configure(ITensor *input, ITensor *output, ActivationLayerInfo activation_info)
[NEActivationLayer snippet]
void configure(const ITensor *input, ITensor *output)
Initialise the kernel's inputs and output.
TensorAllocator * allocator()
Return a pointer to the tensor's allocator.
auto recurrent_to_forget_weights
#define ARM_COMPUTE_ERROR_THROW_ON(status)
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
bool auto_init_if_empty(ITensorInfo &info, const TensorShape &shape, int num_channels, DataType data_type, QuantizationInfo quantization_info=QuantizationInfo())
Auto initialize the tensor info (shape, number of channels and data type) if the current assignment i...
void mark_as_unused() const
Marks a tensor as unused.
void configure(const ITensor *input, ITensor *output)
Configure the kernel.
void run() override
Run the kernels contained in the function.
UniformQuantizationInfo uniform() const
Return per layer quantization info.
auto recurrent_to_output_weights
static Status validate(const std::vector< const ITensorInfo * > &inputs_vector, const ITensorInfo *output, size_t axis)
Static function to check if given info will lead to a valid configuration of NEConcatenateLayer.
void run() override
Run the kernels contained in the function.
ITensorInfo * info() const override
Interface to be implemented by the child class to return the tensor's metadata.
static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, ConvertPolicy policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of NEArithmeticAddition.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
void configure(const ITensor *input1, const ITensor *input2, ITensor *output, float scale, ConvertPolicy overflow_policy, RoundingPolicy rounding_policy, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Initialise the kernel's inputs, output and convertion policy.
void run() override
Run the kernels contained in the function.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_QUANTIZATION_INFO(...)
void run() override
Run the kernels contained in the function.
void allocate() override
Allocate size specified by TensorInfo of CPU memory.
@ TO_ZERO
Truncates the least significant values that are lost in operations.
void configure(const ITensor *input, ITensor *output)
Set the input and output tensors.
@ S32
signed 32-bit number
auto recurrent_to_input_weights
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
Status calculate_quantized_multiplier(float multiplier, int32_t *quant_multiplier, int32_t *shift, bool ignore_epsilon=false)
Calculate quantized representation of multiplier.
void run() override
Run the kernels contained in the function.
static Status validate(const ITensorInfo *input, const ITensorInfo *output)
Static function to check if given info will lead to a valid configuration of NEQuantizationLayer.
void free() override
Free allocated CPU memory.
QuantizationInfo qasymm(1.f/128.f, 128)
@ F32
32-bit floating-point number
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
static Status validate(const ITensorInfo *input, const ITensorInfo *output)
Static function to check if given info will lead to a valid configuration of NEDequantizationLayer.
auto input_to_forget_weights
void run() override
Run the kernels contained in the function.
#define ARM_COMPUTE_LOG_PARAMS(...)
QuantizationInfo qsymm_4(16.f/32768.f, 0)
auto input_to_output_weights
@ QUANTIZE_DOWN_FIXEDPOINT
Quantize using a fixed point multiplication.
QuantizationInfo qsymm_3(8.f/32768.f, 0)
auto input_to_input_weights
auto input_to_cell_weights
auto recurrent_to_cell_weights
virtual ITensorInfo & set_quantization_info(const QuantizationInfo &quantization_info)=0
Set the quantization settings (scale and offset) of the tensor.
void run() override
Run the kernels contained in the function.
void configure(const ITensor *input, ITensor *output, const Coordinates &starts, const Coordinates &ends)
Configure kernel.