24.02.1
|
Go to the documentation of this file.
58 const unsigned int num_elems_per_input_plane = original_input_shape[
width_idx] * original_input_shape[
height_idx];
59 const unsigned int num_channels = original_input_shape[
channel_idx];
66 ICpuKernel::configure(win);
81 if ((
dst !=
nullptr) && (
dst->total_size() != 0))
99 const unsigned int dst_stride_x =
dst->info()->strides_in_bytes().x();
100 const unsigned int dst_stride_y =
dst->info()->strides_in_bytes().y();
101 const unsigned int element_size =
src->info()->element_size();
110 memcpy(output.
ptr() +
id.x() * dst_stride_x +
111 (
id.y() % _factor1 * _factor2 +
id.y() / _factor1) * dst_stride_y,
112 input.ptr(), element_size);
119 return "CpuConvertFullyConnectedWeightsKernel";
Class to describe a number of elements in each dimension.
@ NCHW
Num samples, channels, height, width.
SimpleTensor< float > src
void configure(const ITensorInfo *src, ITensorInfo *dst, const TensorShape &original_input_shape, DataLayout data_layout)
Set the src and dst tensor.
DataLayout
[DataLayout enum definition]
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
@ NHWC
Num samples, height, width, channels.
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(...)
void run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
constexpr auto data_layout
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
constexpr uint8_t * ptr() const
Return a pointer to the current pixel.
const ITensor * get_const_tensor(int id) const
Get constant tensor of a given id.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
size_t total_size_lower(size_t dimension) const
Compute size of dimensions lower than the given one.
void execute_window_loop(const Window &w, L &&lambda_function, Ts &&...iterators)
Iterate through the passed window, automatically adjusting the iterators and calling the lambda_funct...
Iterator updated by execute_window_loop for each window element.
#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...
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
const Window & window() const
The maximum window the kernel can be executed on.
Information about executing thread and CPU.
size_t get_data_layout_dimension_index(const DataLayout &data_layout, const DataLayoutDimension &data_layout_dimension)
Get the index of the given dimension.
Describe a multidimensional execution window.
static Status validate(const ITensorInfo *src, const ITensorInfo *dst, const TensorShape &original_input_shape, DataLayout data_layout)
Static function to check if given info will lead to a valid configuration.
Copyright (c) 2017-2024 Arm Limited.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
@ UNKNOWN
Unknown data layout.
Store the tensor's metadata.
const char * name() const override
Name of the kernel.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
@ UNKNOWN
Unknown data type.