21.02
|
Interface to convert the 2D Fully Connected weights from NCHW to NHWC or vice versa. More...
#include <NEConvertFullyConnectedWeightsKernel.h>
Public Member Functions | |
const char * | name () const override |
Name of the kernel. More... | |
NEConvertFullyConnectedWeightsKernel () | |
Default constructor. More... | |
NEConvertFullyConnectedWeightsKernel (const NEConvertFullyConnectedWeightsKernel &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEConvertFullyConnectedWeightsKernel & | operator= (const NEConvertFullyConnectedWeightsKernel &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEConvertFullyConnectedWeightsKernel (NEConvertFullyConnectedWeightsKernel &&)=default | |
Allow instances of this class to be moved. More... | |
NEConvertFullyConnectedWeightsKernel & | operator= (NEConvertFullyConnectedWeightsKernel &&)=default |
Allow instances of this class to be moved. More... | |
~NEConvertFullyConnectedWeightsKernel ()=default | |
Default destructor. More... | |
void | configure (const ITensor *input, ITensor *output, const TensorShape &original_input_shape, DataLayout data_layout) |
Set the input and output tensor. More... | |
void | run (const Window &window, const ThreadInfo &info) override |
Execute the kernel on the passed window. More... | |
Public Member Functions inherited from ICPPKernel | |
virtual | ~ICPPKernel ()=default |
Default destructor. More... | |
virtual void | run_nd (const Window &window, const ThreadInfo &info, const Window &thread_locator) |
legacy compatibility layer for implemantions which do not support thread_locator In these cases we simply narrow the interface down the legacy version More... | |
virtual void | run_op (ITensorPack &tensors, const Window &window, const ThreadInfo &info) |
Execute the kernel on the passed window. More... | |
Public Member Functions inherited from IKernel | |
IKernel () | |
Constructor. More... | |
virtual | ~IKernel ()=default |
Destructor. More... | |
virtual bool | is_parallelisable () const |
Indicates whether or not the kernel is parallelisable. More... | |
virtual BorderSize | border_size () const |
The size of the border for that kernel. More... | |
const Window & | window () const |
The maximum window the kernel can be executed on. More... | |
Static Public Member Functions | |
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 NEConvertFullyConnectedWeightsKernel. More... | |
Interface to convert the 2D Fully Connected weights from NCHW to NHWC or vice versa.
Definition at line 42 of file NEConvertFullyConnectedWeightsKernel.h.
Default constructor.
Definition at line 33 of file NEConvertFullyConnectedWeightsKernel.cpp.
Referenced by NEConvertFullyConnectedWeightsKernel::name().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
Allow instances of this class to be moved.
|
default |
Default destructor.
Referenced by NEConvertFullyConnectedWeightsKernel::name().
void configure | ( | const ITensor * | input, |
ITensor * | output, | ||
const TensorShape & | original_input_shape, | ||
DataLayout | data_layout | ||
) |
Set the input and output tensor.
[in] | input | Source weights tensor to convert. Must be 2 dimensional. Data types supported: All. |
[out] | output | The converted weights tensor. Shape and Data Type: Same as input . |
[in] | original_input_shape | Shape of the original input tensor (the one entering fully connected layer). |
[in] | data_layout | The data layout the weights have been trained in. |
Definition at line 38 of file NEConvertFullyConnectedWeightsKernel.cpp.
References ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::auto_init_if_empty(), arm_compute::calculate_max_window(), arm_compute::CHANNEL, ICloneable< T >::clone(), arm_compute::test::validation::data_layout, arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, ITensor::info(), arm_compute::test::validation::input, arm_compute::NCHW, arm_compute::NHWC, NEConvertFullyConnectedWeightsKernel::validate(), and arm_compute::WIDTH.
Referenced by NEConvertFullyConnectedWeightsKernel::name().
|
inlineoverridevirtual |
Name of the kernel.
Implements ICPPKernel.
Definition at line 45 of file NEConvertFullyConnectedWeightsKernel.h.
References NEConvertFullyConnectedWeightsKernel::configure(), arm_compute::test::validation::data_layout, arm_compute::test::validation::info, arm_compute::test::validation::input, NEConvertFullyConnectedWeightsKernel::NEConvertFullyConnectedWeightsKernel(), NEConvertFullyConnectedWeightsKernel::operator=(), NEConvertFullyConnectedWeightsKernel::run(), NEConvertFullyConnectedWeightsKernel::validate(), IKernel::window(), and NEConvertFullyConnectedWeightsKernel::~NEConvertFullyConnectedWeightsKernel().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
Referenced by NEConvertFullyConnectedWeightsKernel::name().
|
default |
Allow instances of this class to be moved.
|
overridevirtual |
Execute the kernel on the passed window.
[in] | window | Region on which to execute the kernel. (Must be a region of the window returned by window()) |
[in] | info | Info about executing thread and CPU. |
Reimplemented from ICPPKernel.
Definition at line 104 of file NEConvertFullyConnectedWeightsKernel.cpp.
References ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, ARM_COMPUTE_UNUSED, ITensorInfo::element_size(), ITensor::info(), and IKernel::window().
Referenced by NEConvertFullyConnectedWeightsKernel::name().
|
static |
Static function to check if given info will lead to a valid configuration of NEConvertFullyConnectedWeightsKernel.
[in] | input | Source weights tensor info to convert. Must be 2 dimensional. Data types supported: All. |
[in] | output | The converted weights tensor info. Shape and Data Type: Same as input . |
[in] | original_input_shape | Shape of the original input tensor (the one entering fully connected layer). |
[in] | data_layout | The data layout the weights have been trained in. |
Definition at line 68 of file NEConvertFullyConnectedWeightsKernel.cpp.
References ARM_COMPUTE_RETURN_ERROR_ON, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES, ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR, ITensorInfo::data_type(), ITensorInfo::dimension(), arm_compute::execute_window_loop(), ITensor::info(), arm_compute::test::validation::input, ITensorInfo::num_dimensions(), Iterator::ptr(), ITensorInfo::strides_in_bytes(), ITensorInfo::total_size(), TensorShape::total_size_lower(), arm_compute::UNKNOWN, IKernel::window(), Dimensions< T >::x(), and Dimensions< T >::y().
Referenced by NEConvertFullyConnectedWeightsKernel::configure(), NEConvertFullyConnectedWeightsKernel::name(), and NEConvertFullyConnectedWeights::validate().