50 _num_srcs = srcs_vector.size();
60 for(
unsigned int i = 0; i < _num_srcs; ++i)
66 auto kernel = std::make_unique<kernels::CpuConcatenateWidthKernel>();
67 kernel->configure(srcs_vector.at(i),
offset,
dst);
68 _concat_kernels.emplace_back(std::move(kernel));
73 auto kernel = std::make_unique<kernels::CpuConcatenateHeightKernel>();
74 kernel->configure(srcs_vector.at(i),
offset,
dst);
75 _concat_kernels.emplace_back(std::move(kernel));
80 auto kernel = std::make_unique<kernels::CpuConcatenateDepthKernel>();
81 kernel->configure(srcs_vector.at(i),
offset,
dst);
82 _concat_kernels.emplace_back(std::move(kernel));
87 auto kernel = std::make_unique<kernels::CpuConcatenateBatchKernel>();
88 kernel->configure(srcs_vector.at(i),
offset,
dst);
89 _concat_kernels.emplace_back(std::move(kernel));
95 offset += srcs_vector.at(i)->dimension(axis);
105 for(
const auto &
src : srcs_vector)
133 offset +=
src->dimension(axis);
152 if(static_cast<int>(tensors.
size() - 1) != static_cast<int>(_num_srcs))
158 for(
auto &k : _concat_kernels)
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
void configure(const std::vector< const ITensorInfo *> &srcs_vector, ITensorInfo *dst, size_t axis)
Configure operator for a given list of arguments.
bool empty() const
Checks if pack is empty.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
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.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Store the tensor's metadata.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
void run(ITensorPack &tensors) override
Run the kernels contained in the function.
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
SimpleTensor< float > src
Copyright (c) 2017-2021 Arm Limited.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
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.
const ITensor * get_const_tensor(int id) const
Get constant tensor of a given id.
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
size_t total_size() const
Collapses all dimensions to a single linear total size.
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.
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 size() const
Pack size accessor.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
ITensor * get_tensor(int id)
Get tensor of a given id from the pac.
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.
virtual size_t total_size() const =0
Returns the total size of the tensor in bytes.
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.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
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.
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.
static IScheduler & get()
Access the scheduler singleton.