Compute Library
 21.02
CLFullyConnectedLayer Class Reference

Basic function to compute a Fully Connected layer on OpenCL. More...

#include <CLFullyConnectedLayer.h>

Collaboration diagram for CLFullyConnectedLayer:
[legend]

Public Member Functions

 CLFullyConnectedLayer (std::shared_ptr< IMemoryManager > memory_manager=nullptr, IWeightsManager *weights_manager=nullptr)
 Constructor. More...
 
 CLFullyConnectedLayer (const CLFullyConnectedLayer &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 CLFullyConnectedLayer (CLFullyConnectedLayer &&)=default
 Default move constructor. More...
 
CLFullyConnectedLayeroperator= (const CLFullyConnectedLayer &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
CLFullyConnectedLayeroperator= (CLFullyConnectedLayer &&)=default
 Default move assignment operator. More...
 
void configure (const ICLTensor *input, const ICLTensor *weights, const ICLTensor *biases, ICLTensor *output, FullyConnectedLayerInfo fc_info=FullyConnectedLayerInfo())
 Set the input and output tensors. More...
 
void configure (const CLCompileContext &compile_context, const ICLTensor *input, const ICLTensor *weights, const ICLTensor *biases, ICLTensor *output, FullyConnectedLayerInfo fc_info=FullyConnectedLayerInfo())
 Set the input and output tensors. 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 *biases, const ITensorInfo *output, FullyConnectedLayerInfo fc_info=FullyConnectedLayerInfo())
 Static function to check if given info will lead to a valid configuration of CLFullyConnectedLayer. More...
 

Detailed Description

Basic function to compute a Fully Connected layer on OpenCL.

This function calls the following OpenCL kernels:

  1. CLIm2ColKernel (called when the input comes from a convolutional layer)
  2. CLFullyConnectedLayerReshapeWeights (if are_weights_reshaped is set to false and transpose_weights is set to true ) (called once)
  3. CLGEMMMatrixMultiplyKernel or CLGEMMLowpMatrixMultiplyCore (if quantized asymmetric)
Note
The fully connected layer accepts "weights" tensors only with 2 dimensions.

Definition at line 136 of file CLFullyConnectedLayer.h.

Constructor & Destructor Documentation

◆ CLFullyConnectedLayer() [1/3]

CLFullyConnectedLayer ( std::shared_ptr< IMemoryManager memory_manager = nullptr,
IWeightsManager weights_manager = nullptr 
)

Constructor.

Definition at line 161 of file CLFullyConnectedLayer.cpp.

162  : _memory_group(memory_manager), _weights_manager(weights_manager), _convert_weights(), _convert_weights_managed(), _reshape_weights_managed_function(), _flatten_layer(), _reshape_weights_function(),
163  _mm_gemm(memory_manager, weights_manager), _mm_gemmlowp(memory_manager), _flatten_output(), _converted_weights_output(), _reshape_weights_output(), _are_weights_converted(true),
164  _are_weights_reshaped(true), _is_fc_after_conv(true), _is_quantized(false), _is_prepared(false), _original_weights(nullptr)
165 {
166 }

◆ CLFullyConnectedLayer() [2/3]

Prevent instances of this class from being copied (As this class contains pointers)

◆ CLFullyConnectedLayer() [3/3]

Default move constructor.

Member Function Documentation

◆ configure() [1/2]

void configure ( const ICLTensor input,
const ICLTensor weights,
const ICLTensor biases,
ICLTensor output,
FullyConnectedLayerInfo  fc_info = FullyConnectedLayerInfo() 
)

Set the input and output tensors.

Parameters
[in]inputSource tensor. Data type supported: QASYMM8/QASYMM8_SIGNED/F16/F32.
[in]weightsWeights tensor. The weights must be 2 dimensional. If this function is called after a Convolution Layer, the (transposed) weights will have as many rows as the product of the first 3 input's dimensions. If it is called after another FullyConnected Layer, the (transposed) weights will have as many rows as the input's first dimension. Data type supported: Same as input.
[in]biasesBias tensor. Can be nullptr. Data type supported:Same as input.
[out]outputDestination tensor. Its shape should be equal to the output of a matrix multiplication between:
  • The output of im2col on the input and the (transposed) 2D weights, if the function is called after a Convolution Layer
  • The input tensor and the (transposed) 2D weights, if the function is called after another FullyConnected Layer. Data type supported: Same as input.
[in]fc_info(Optional) Fully connected layer additional info

Definition at line 239 of file CLFullyConnectedLayer.cpp.

References CLKernelLibrary::get().

Referenced by CLRNNLayer::configure(), and CLLSTMLayer::configure().

241 {
242  configure(CLKernelLibrary::get().get_compile_context(), input, weights, biases, output, fc_info);
243 }
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
void configure(const ICLTensor *input, const ICLTensor *weights, const ICLTensor *biases, ICLTensor *output, FullyConnectedLayerInfo fc_info=FullyConnectedLayerInfo())
Set the input and output tensors.

◆ configure() [2/2]

void configure ( const CLCompileContext compile_context,
const ICLTensor input,
const ICLTensor weights,
const ICLTensor biases,
ICLTensor output,
FullyConnectedLayerInfo  fc_info = FullyConnectedLayerInfo() 
)

Set the input and output tensors.

Parameters
[in]compile_contextThe compile context to be used.
[in]inputSource tensor. Data type supported: QASYMM8/QASYMM8_SIGNED/F16/F32.
[in]weightsWeights tensor. The weights must be 2 dimensional. If this function is called after a Convolution Layer, the (transposed) weights will have as many rows as the product of the first 3 input's dimensions. If it is called after another FullyConnected Layer, the (transposed) weights will have as many rows as the input's first dimension. Data type supported: Same as input.
[in]biasesBias tensor. Can be nullptr. Data type supported:Same as input.
[out]outputDestination tensor. Its shape should be equal to the output of a matrix multiplication between:
  • The output of im2col on the input and the (transposed) 2D weights, if the function is called after a Convolution Layer
  • The input tensor and the (transposed) 2D weights, if the function is called after another FullyConnected Layer. Data type supported: Same as input.
[in]fc_info(Optional) Fully connected layer additional info

Definition at line 245 of file CLFullyConnectedLayer.cpp.

References IWeightsManager::acquire(), IWeightsManager::are_weights_managed(), FullyConnectedLayerInfo::are_weights_reshaped, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, Dimensions< T >::cbegin(), Dimensions< T >::cend(), CLConvertFullyConnectedWeights::configure(), CLFullyConnectedLayerReshapeWeights::configure(), CLFullyConnectedLayerReshapeWeightsManaged::configure(), CLConvertFullyConnectedWeightsManaged::configure(), ITensorInfo::data_layout(), ITensorInfo::data_type(), ITensorInfo::dimension(), ITensor::info(), arm_compute::is_data_type_quantized_asymmetric(), IWeightsManager::manage(), ITensorInfo::num_dimensions(), Dimensions< size_t >::num_max_dimensions, FullyConnectedLayerInfo::retain_internal_weights, ITensorInfo::tensor_shape(), FullyConnectedLayerInfo::transpose_weights, CLFullyConnectedLayer::validate(), and FullyConnectedLayerInfo::weights_trained_layout.

247 {
248  ARM_COMPUTE_ERROR_ON_NULLPTR(input, weights, output);
249 
250  // Perform validate step
252  weights->info(),
253  biases != nullptr ? biases->info() : nullptr,
254  output->info(),
255  fc_info));
256 
257  _are_weights_converted = true;
258  _are_weights_reshaped = fc_info.transpose_weights ? fc_info.are_weights_reshaped : true;
259  _is_fc_after_conv = true;
260  _is_quantized = is_data_type_quantized_asymmetric(input->info()->data_type());
261  _is_prepared = fc_info.retain_internal_weights;
262  _original_weights = weights;
263 
264  if(_weights_manager)
265  {
266  _weights_manager->manage(weights);
267  }
268 
269  const ICLTensor *weights_to_use = weights;
270 
271  // With the Fully Connected layer we can have 4 different cases:
272  // 1) Convolution layer -> Fully Connected layer without batches
273  // 2) Fully Connected layer -> Fully Connected layer without batches
274  // 3) Convolution layer -> Fully Connected layer with batches
275  // 4) Fully Connected layer -> Fully Connected layer with batches
276 
277  // Check if we have a fully connected layer with batches
278  const bool is_batched_fc_layer = output->info()->dimension(1) > 1;
279  if(is_batched_fc_layer)
280  {
281  _is_fc_after_conv = (TensorShape::num_max_dimensions >= 4) && (std::equal(input->info()->tensor_shape().cbegin() + 3,
282  input->info()->tensor_shape().cend(),
283  output->info()->tensor_shape().cbegin() + 1));
284  }
285  else
286  {
287  _is_fc_after_conv = input->info()->num_dimensions() > 1;
288  }
289 
290  // Reshape weights if needed
291  if(!_are_weights_reshaped)
292  {
293  if(_weights_manager && _weights_manager->are_weights_managed(weights))
294  {
295  _reshape_weights_managed_function.configure(compile_context, weights);
296  weights_to_use = utils::cast::polymorphic_downcast<ICLTensor *>(_weights_manager->acquire(weights, &_reshape_weights_managed_function));
297  }
298  else
299  {
300  // Reshape the weights
301  _reshape_weights_function.configure(compile_context, weights, &_reshape_weights_output);
302  weights_to_use = &_reshape_weights_output;
303  }
304  }
305 
306  // Convert weights if needed
307  if(_is_fc_after_conv && (input->info()->data_layout() != fc_info.weights_trained_layout))
308  {
309  if(_weights_manager && _weights_manager->are_weights_managed(weights_to_use))
310  {
311  _convert_weights_managed.configure(compile_context, weights_to_use,
312  input->info()->tensor_shape(),
313  fc_info.weights_trained_layout);
314  weights_to_use = utils::cast::polymorphic_downcast<ICLTensor *>(_weights_manager->acquire(weights, &_convert_weights_managed));
315  }
316  else
317  {
318  // Convert weights
319  _convert_weights.configure(compile_context, weights_to_use,
320  &_converted_weights_output,
321  input->info()->tensor_shape(),
322  fc_info.weights_trained_layout);
323 
324  weights_to_use = &_converted_weights_output;
325  }
326  _are_weights_converted = false;
327  }
328 
329  if(_is_fc_after_conv)
330  {
331  // Fully Connected layer after a Convolution Layer without batches
332  configure_conv_fc(compile_context, input, weights_to_use, biases, output, fc_info);
333  }
334  else
335  {
336  // Fully Connected layer after a Fully Connected Layer without batches
337  configure_fc_fc(compile_context, input, weights_to_use, biases, output, fc_info);
338  }
339 }
void configure(const ICLTensor *input)
Configures the CLFullyConnectedLayerReshapeWeights function.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
Definition: Error.h:455
void manage(const ITensor *weights, ITransformWeights *parent=nullptr)
Start managing a weights tensor.
bool are_weights_managed(const ITensor *weights)
Check if the weights are managed.
static Status validate(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output, FullyConnectedLayerInfo fc_info=FullyConnectedLayerInfo())
Static function to check if given info will lead to a valid configuration of CLFullyConnectedLayer.
bool is_data_type_quantized_asymmetric(DataType dt)
Check if a given data type is of asymmetric quantized type.
Definition: Utils.h:1190
void configure(const ICLTensor *input, ICLTensor *output, const TensorShape &original_input_shape, DataLayout data_layout)
Initialize the function.
void configure(const ICLTensor *input, ICLTensor *output)
Set the input and output tensors.
void configure(const ICLTensor *input, const TensorShape &original_input_shape, DataLayout data_layout)
Configures the CLConvertFullyConnectedWeights function.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:161
static constexpr size_t num_max_dimensions
Number of dimensions the tensor has.
Definition: Dimensions.h:46
ITensor * acquire(const ITensor *weights, ITransformWeights *weights_transform)
Acquire the requested reshape tensor of the selected weights.

◆ operator=() [1/2]

CLFullyConnectedLayer& operator= ( const CLFullyConnectedLayer )
delete

Prevent instances of this class from being copied (As this class contains pointers)

◆ operator=() [2/2]

CLFullyConnectedLayer& operator= ( CLFullyConnectedLayer &&  )
default

Default move assignment operator.

◆ prepare()

void prepare ( )
overridevirtual

Prepare the function for executing.

Any one off pre-processing step required by the function is handled here

Note
Prepare stage might not need all the function's buffers' backing memory to be available in order to execute

Reimplemented from IFunction.

Definition at line 441 of file CLFullyConnectedLayer.cpp.

References CLTensorAllocator::allocate(), CLTensor::allocator(), IWeightsManager::are_weights_managed(), ARM_COMPUTE_ERROR_ON, CLScheduler::get(), ITensor::is_used(), ITensor::mark_as_unused(), CLGEMM::prepare(), CLScheduler::queue(), ICLSimpleFunction::run(), IWeightsManager::run(), and arm_compute::test::validation::w.

Referenced by CLRNNLayer::prepare(), and CLFullyConnectedLayer::run().

442 {
443  if(!_is_prepared)
444  {
445  if(!_weights_manager)
446  {
447  ARM_COMPUTE_ERROR_ON(!_original_weights->is_used());
448  }
449 
450  auto release_unused = [](CLTensor * w)
451  {
452  if(!w->is_used())
453  {
454  CLScheduler::get().queue().finish();
455  w->allocator()->free();
456  }
457  };
458 
459  // Pointer to current weights
460  const ICLTensor *cur_weights = _original_weights;
461 
462  // Reshape of the weights if needed (happens only once)
463  if(!_are_weights_reshaped)
464  {
465  if(_weights_manager && _weights_manager->are_weights_managed(_original_weights))
466  {
467  cur_weights = utils::cast::polymorphic_downcast<ICLTensor *>(_weights_manager->run(cur_weights, &_reshape_weights_managed_function));
468  }
469  else
470  {
471  // Run reshape weights kernel and mark weights as unused
472  _reshape_weights_output.allocator()->allocate();
473  _reshape_weights_function.run();
474 
475  cur_weights->mark_as_unused();
476  cur_weights = &_reshape_weights_output;
477  }
478  _are_weights_reshaped = true;
479  }
480 
481  // Convert weights if needed (happens only once)
482  if(!_are_weights_converted)
483  {
484  if(_weights_manager && _weights_manager->are_weights_managed(cur_weights))
485  {
486  _weights_manager->run(cur_weights, &_convert_weights_managed);
487  }
488  else
489  {
490  _converted_weights_output.allocator()->allocate();
491  _convert_weights.run();
492  cur_weights->mark_as_unused();
493  }
494 
495  _are_weights_converted = true;
496  }
497 
498  // Release reshaped weights if unused
499  release_unused(&_reshape_weights_output);
500 
501  // Prepare GEMM prepare and release unused weights
502  if(!_is_quantized)
503  {
504  _mm_gemm.prepare();
505  }
506 
507  // Release converted weights if unused
508  release_unused(&_reshape_weights_output);
509  release_unused(&_converted_weights_output);
510 
511  _is_prepared = true;
512  }
513 }
SimpleTensor< float > w
Definition: DFT.cpp:156
void prepare() override
Prepare the function for executing.
Definition: CLGEMM.cpp:870
static CLScheduler & get()
Access the scheduler singleton.
bool is_used() const
Flags if the tensor is used or not.
Definition: ITensor.cpp:163
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
CLTensorAllocator * allocator()
Return a pointer to the tensor&#39;s allocator.
Definition: CLTensor.cpp:61
bool are_weights_managed(const ITensor *weights)
Check if the weights are managed.
void run() override final
Run the kernels contained in the function.
cl::CommandQueue & queue()
Accessor for the associated CL command queue.
Definition: CLScheduler.cpp:41
void allocate() override
Allocate size specified by TensorInfo of OpenCL memory.
ITensor * run(const ITensor *weights, ITransformWeights *weights_transform)
Run the reshape function.

◆ run()

void run ( )
overridevirtual

Run the kernels contained in the function.

For Neon kernels:

  • Multi-threading is used for the kernels which are parallelisable.
  • By default std::thread::hardware_concurrency() threads are used.
Note
CPPScheduler::set_num_threads() can be used to manually set the number of threads

For OpenCL kernels:

  • All the kernels are enqueued on the queue associated with CLScheduler.
  • The queue is then flushed.
Note
The function will not block until the kernels are executed. It is the user's responsibility to wait.
Will call prepare() on first run if hasn't been done

Implements IFunction.

Definition at line 418 of file CLFullyConnectedLayer.cpp.

References CLFullyConnectedLayer::prepare(), CLFlattenLayer::run(), CLGEMMLowpMatrixMultiplyCore::run(), and CLGEMM::run().

Referenced by CLRNNLayer::run(), and CLLSTMLayer::run().

419 {
420  prepare();
421 
422  MemoryGroupResourceScope scope_mg(_memory_group);
423 
424  // Linearize input if it comes from a convolutional layer
425  if(_is_fc_after_conv)
426  {
427  _flatten_layer.run();
428  }
429 
430  // Run matrix multiply
431  if(_is_quantized)
432  {
433  _mm_gemmlowp.run();
434  }
435  else
436  {
437  _mm_gemm.run();
438  }
439 }
void run() override
Run the kernels contained in the function.
Definition: CLGEMM.cpp:778
void run() override
Run the kernels contained in the function.
void prepare() override
Prepare the function for executing.
void run() override
Run the kernels contained in the function.

◆ validate()

Status validate ( const ITensorInfo input,
const ITensorInfo weights,
const ITensorInfo biases,
const ITensorInfo output,
FullyConnectedLayerInfo  fc_info = FullyConnectedLayerInfo() 
)
static

Static function to check if given info will lead to a valid configuration of CLFullyConnectedLayer.

Parameters
[in]inputSource tensor info. Data type supported: QASYMM8/QASYMM8_SIGNED/F16/F32.
[in]weightsWeights tensor info. The weights must be 2 dimensional. If this function is called after a Convolution Layer, the (transposed) weights will have as many rows as the product of the first 3 input's dimensions. If it is called after another FullyConnected Layer, the (transposed) weights will have as many rows as the input's first dimension. Data type supported: Same as input.
[in]biasesBias tensor info. Can be nullptr. Data type supported:Same as input.
[out]outputDestination tensor info. Its shape should be equal to the output of a matrix multiplication between:
  • The output of im2col on the input and the (transposed) 2D weights, if the function is called after a Convolution Layer
  • The input tensor and the (transposed) 2D weights, if the function is called after another FullyConnected Layer. Data type supported: Same as input.
[in]fc_info(Optional) Fully connected layer additional info
Returns
a status

Definition at line 341 of file CLFullyConnectedLayer.cpp.

References ActivationLayerInfo::activation(), FullyConnectedLayerInfo::activation_info, FullyConnectedLayerInfo::are_weights_reshaped, ARM_COMPUTE_RETURN_ERROR_ON, ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES, ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR, ARM_COMPUTE_RETURN_ON_ERROR, ActivationLayerInfo::BOUNDED_RELU, Dimensions< T >::cbegin(), Dimensions< T >::cend(), ICloneable< T >::clone(), arm_compute::misc::shape_calculator::compute_flatten_shape(), arm_compute::misc::shape_calculator::compute_transposed_shape(), ITensorInfo::data_layout(), ITensorInfo::data_type(), ITensorInfo::dimension(), ActivationLayerInfo::enabled(), arm_compute::F16, arm_compute::F32, arm_compute::test::validation::input, arm_compute::is_data_type_quantized(), ActivationLayerInfo::LU_BOUNDED_RELU, arm_compute::NCHW, ITensorInfo::num_dimensions(), Dimensions< size_t >::num_max_dimensions, arm_compute::QASYMM8, arm_compute::QASYMM8_SIGNED, ActivationLayerInfo::RELU, ITensorInfo::tensor_shape(), FullyConnectedLayerInfo::transpose_weights, CLFullyConnectedLayerReshapeWeights::validate(), CLFlattenLayer::validate(), CLConvertFullyConnectedWeights::validate(), and FullyConnectedLayerInfo::weights_trained_layout.

Referenced by CLFullyConnectedLayer::configure(), arm_compute::test::validation::DATA_TEST_CASE(), CLRNNLayer::validate(), and CLLSTMLayer::validate().

343 {
344  ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input, weights, output);
347  ARM_COMPUTE_RETURN_ERROR_ON(weights->num_dimensions() > 2);
348  ARM_COMPUTE_RETURN_ERROR_ON(fc_info.activation_info.enabled() && is_data_type_quantized(input->data_type()) && fc_info.activation_info.activation() != ActivationLayerInfo::ActivationFunction::RELU
349  && fc_info.activation_info.activation() != ActivationLayerInfo::ActivationFunction::BOUNDED_RELU && fc_info.activation_info.activation() != ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU);
350 
351  bool weights_reshaped = fc_info.transpose_weights ? fc_info.are_weights_reshaped : true;
352  bool is_fc_after_conv = true;
353 
354  const ITensorInfo &flatten_input = TensorInfo(input->clone()->set_is_resizable(true).reset_padding().set_tensor_shape(compute_flatten_shape(input)).set_data_layout(DataLayout::NCHW));
355  const ITensorInfo &reshaped_weights = TensorInfo(weights->clone()->set_is_resizable(true).reset_padding().set_tensor_shape(compute_transposed_shape(*weights)));
356  const ITensorInfo &converted_weights = weights_reshaped ? TensorInfo(weights->clone()->set_is_resizable(true).reset_padding()) : TensorInfo(*reshaped_weights.clone());
357 
358  // With the Fully Connected layer we can have 4 different cases:
359  // 1) Convolution layer -> Fully Connected layer without batches
360  // 2) Fully Connected layer -> Fully Connected layer without batches
361  // 3) Convolution layer -> Fully Connected layer with batches
362  // 4) Fully Connected layer -> Fully Connected layer with batches
363 
364  const ITensorInfo *input_to_use = input;
365  const ITensorInfo *weights_to_use = weights;
366 
367  // Check if we have a fully connected layer with batches
368  const bool is_batched_fc_layer = output->dimension(1) > 1;
369  if(is_batched_fc_layer)
370  {
371  is_fc_after_conv = (TensorShape::num_max_dimensions >= 4) && (std::equal(input->tensor_shape().cbegin() + 3,
372  input->tensor_shape().cend(),
373  output->tensor_shape().cbegin() + 1));
374  }
375  else
376  {
377  is_fc_after_conv = input->num_dimensions() > 1;
378  }
379 
380  if(!weights_reshaped)
381  {
382  // Validate reshape weights kernel
384  weights_to_use = &reshaped_weights;
385  }
386 
387  if(is_fc_after_conv && (input->data_layout() != fc_info.weights_trained_layout))
388  {
389  // Validate convert weights kernel
391  &converted_weights,
392  input->tensor_shape(),
393  fc_info.weights_trained_layout));
394  weights_to_use = &converted_weights;
395  }
396 
397  if(is_fc_after_conv)
398  {
399  // Fully Connected layer after a Convolution Layer without batches
400  ARM_COMPUTE_RETURN_ERROR_ON((weights_to_use->dimension(1) != (input->dimension(0) * input->dimension(1) * input->dimension(2))));
401 
402  // Validate flatten kernel
404  input_to_use = &flatten_input;
405  }
406  else
407  {
408  // Fully Connected layer after a Fully Connected Layer without batches
409  ARM_COMPUTE_RETURN_ERROR_ON(input->dimension(0) != weights_to_use->dimension(1));
410  }
411 
412  // Validate matrix multiply kernel
413  ARM_COMPUTE_RETURN_ON_ERROR(validate_mm(*input_to_use, *weights_to_use, biases, *output, fc_info));
414 
415  return Status{};
416 }
bool is_data_type_quantized(DataType dt)
Check if a given data type is of quantized type.
Definition: Utils.h:1168
static Status validate(const ITensorInfo *input, const ITensorInfo *output)
Static function to check if given info will lead to a valid configuration of CLFlattenLayer.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
Definition: Error.h:204
1 channel, 1 F32 per channel
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
Definition: Error.h:296
1 channel, 1 F16 per channel
TensorShape compute_transposed_shape(const ITensorInfo &input)
Calculate the transposed shape of a tensor.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
Definition: Validate.h:163
TensorShape compute_flatten_shape(const ITensorInfo *input)
Calculate the flattened output shape of a tensor.
quantized, asymmetric fixed-point 8-bit number unsigned
Num samples, channels, height, width.
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const TensorShape &original_input_shape, DataLayout data_layout)
Static function to check if given info will lead to a valid configuration of CLConvertFullyConnectedW...
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
Definition: Validate.h:545
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
Definition: Validate.h:792
quantized, asymmetric fixed-point 8-bit number signed
static constexpr size_t num_max_dimensions
Number of dimensions the tensor has.
Definition: Dimensions.h:46
static Status validate(const ITensorInfo *input, const ITensorInfo *output)
Static function to check if given info will lead to a valid configuration of CLFullyConnectedLayerRes...

The documentation for this class was generated from the following files: