24.02.1
|
Go to the documentation of this file.
51 _num_srcs = srcs_vector.size();
61 for (
unsigned int i = 0; i < _num_srcs; ++i)
67 auto kernel = std::make_unique<kernels::CpuConcatenateWidthKernel>();
68 kernel->configure(srcs_vector.at(i),
offset,
dst);
69 _concat_kernels.emplace_back(std::move(kernel));
74 auto kernel = std::make_unique<kernels::CpuConcatenateHeightKernel>();
75 kernel->configure(srcs_vector.at(i),
offset,
dst);
76 _concat_kernels.emplace_back(std::move(kernel));
81 auto kernel = std::make_unique<kernels::CpuConcatenateDepthKernel>();
82 kernel->configure(srcs_vector.at(i),
offset,
dst);
83 _concat_kernels.emplace_back(std::move(kernel));
88 auto kernel = std::make_unique<kernels::CpuConcatenateBatchKernel>();
89 kernel->configure(srcs_vector.at(i),
offset,
dst);
90 _concat_kernels.emplace_back(std::move(kernel));
96 offset += srcs_vector.at(i)->dimension(axis);
107 for (
const auto &
src : srcs_vector)
138 if (
dst->total_size() != 0)
154 if (
static_cast<int>(tensors.
size() - 1) !=
static_cast<int>(_num_srcs))
160 for (
auto &k : _concat_kernels)
SimpleTensor< float > src
virtual void schedule_op(ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors)=0
Runs the kernel in the same thread as the caller synchronously.
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
void configure(const std::vector< const ITensorInfo * > &srcs_vector, ITensorInfo *dst, size_t axis)
Configure operator for a given list of arguments.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
TensorShape calculate_concatenate_shape(const std::vector< T * > &input, size_t axis)
Calculate the concatenate output shape of the concatenate operation along a single axis.
void add_tensor(int id, ITensor *tensor)
Add tensor to the pack.
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
static Status validate(const ITensorInfo *src, unsigned int depth_offset, const ITensorInfo *dst)
Static function to check if given info will lead to a valid configuration.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
bool empty() const
Checks if pack is empty.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
const ITensor * get_const_tensor(int id) const
Get constant tensor of a given id.
#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...
size_t total_size() const
Collapses all dimensions to a single linear total size.
static IScheduler & get()
Access the scheduler singleton.
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
size_t size() const
Pack size accessor.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
void run(ITensorPack &tensors) override
Run the kernels contained in the function.
Copyright (c) 2017-2024 Arm Limited.
static Status validate(const ITensorInfo *src, unsigned int height_offset, const ITensorInfo *dst)
Static function to check if given info will lead to a valid configuration.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
static Status validate(const std::vector< const ITensorInfo * > &srcs_vector, const ITensorInfo *dst, size_t axis)
Static function to check if given info will lead to a valid configuration.
static Status validate(const ITensorInfo *src, unsigned int width_offset, const ITensorInfo *dst)
Static function to check if given info will lead to a valid configuration.
Store the tensor's metadata.
static Status validate(const ITensorInfo *src, unsigned int batch_offset, const ITensorInfo *dst)
Static function to check if given info will lead to a valid configuration.
#define ARM_COMPUTE_LOG_PARAMS(...)