MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / configure

Method configure

src/runtime/NEON/functions/NELSTMLayerQuantized.cpp:113–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113void NELSTMLayerQuantized::configure(const ITensor *input,
114 const ITensor *input_to_input_weights,
115 const ITensor *input_to_forget_weights,
116 const ITensor *input_to_cell_weights,
117 const ITensor *input_to_output_weights,
118 const ITensor *recurrent_to_input_weights,
119 const ITensor *recurrent_to_forget_weights,
120 const ITensor *recurrent_to_cell_weights,
121 const ITensor *recurrent_to_output_weights,
122 const ITensor *input_gate_bias,
123 const ITensor *forget_gate_bias,
124 const ITensor *cell_bias,
125 const ITensor *output_gate_bias,
126 ITensor *cell_state_in,
127 const ITensor *output_state_in,
128 ITensor *cell_state_out,
129 ITensor *output_state_out)
130{
131 ARM_COMPUTE_TRACE_EVENT(ARM_COMPUTE_PROF_CAT_CPU, ARM_COMPUTE_PROF_LVL_CPU, "NELSTMLayerQuantized::configure");
132 ARM_COMPUTE_ERROR_ON_NULLPTR(input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights,
133 input_to_output_weights, recurrent_to_input_weights, recurrent_to_forget_weights,
134 recurrent_to_cell_weights, recurrent_to_output_weights, input_gate_bias,
135 forget_gate_bias, cell_bias, output_gate_bias, cell_state_in, output_state_in,
136 cell_state_out, output_state_out);
137
138 ARM_COMPUTE_ERROR_THROW_ON(NELSTMLayerQuantized::validate(
139 input->info(), input_to_input_weights->info(), input_to_forget_weights->info(), input_to_cell_weights->info(),
140 input_to_output_weights->info(), recurrent_to_input_weights->info(), recurrent_to_forget_weights->info(),
141 recurrent_to_cell_weights->info(), recurrent_to_output_weights->info(), input_gate_bias->info(),
142 forget_gate_bias->info(), cell_bias->info(), output_gate_bias->info(), cell_state_in->info(),
143 output_state_in->info(), cell_state_out->info(), output_state_out->info()));
144
145 ARM_COMPUTE_LOG_PARAMS(input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights,
146 input_to_output_weights, recurrent_to_input_weights, recurrent_to_forget_weights,
147 recurrent_to_cell_weights, recurrent_to_output_weights, input_gate_bias, forget_gate_bias,
148 cell_bias, output_gate_bias, cell_state_in, output_state_in, cell_state_out,
149 output_state_out);
150
151 const int input_size = input->info()->dimension(0);
152 const int batch_size = input->info()->dimension(1);
153 const int output_size = input_to_input_weights->info()->dimension(1);
154
155 const QuantizationInfo qweights = input_to_input_weights->info()->quantization_info(); // Weights quantization
156
157 auto_init_if_empty(*cell_state_out->info(),
158 TensorInfo(TensorShape(batch_size, output_size), 1, DataType::QSYMM16, qsymm_4));
159 auto_init_if_empty(*output_state_out->info(),
160 TensorInfo(TensorShape(batch_size, output_size), 1, DataType::QASYMM8, qasymm));
161
162 _input_to_input_weights = input_to_input_weights;
163 _input_to_forget_weights = input_to_forget_weights;
164 _input_to_cell_weights = input_to_cell_weights;
165 _input_to_output_weights = input_to_output_weights;
166 _recurrent_to_input_weights = recurrent_to_input_weights;
167 _recurrent_to_forget_weights = recurrent_to_forget_weights;
168 _recurrent_to_cell_weights = recurrent_to_cell_weights;
169 _recurrent_to_output_weights = recurrent_to_output_weights;
170 _input_gate_bias = input_gate_bias;

Callers

nothing calls this directly

Calls 15

auto_init_if_emptyFunction · 0.85
validateFunction · 0.50
TensorInfoClass · 0.50
TensorShapeClass · 0.50
QuantizationInfoClass · 0.50
ActivationLayerInfoClass · 0.50
infoMethod · 0.45
dimensionMethod · 0.45
quantization_infoMethod · 0.45
initMethod · 0.45
allocatorMethod · 0.45

Tested by

no test coverage detected