Basic function to execute concatenate tensors along a given axis.
More...
#include <GCConcatenateLayer.h>
Basic function to execute concatenate tensors along a given axis.
This function calls the following kernels:
- Note
- only axis z is supported
- GCDepthConcatenateLayerKernel
- Deprecated:
- This function is deprecated and is intended to be removed in 21.05 release
Definition at line 47 of file GCConcatenateLayer.h.
◆ GCConcatenateLayer()
Default constructor.
Definition at line 36 of file GCConcatenateLayer.cpp.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
◆ configure()
void configure |
( |
std::vector< IGCTensor *> |
inputs_vector, |
|
|
IGCTensor * |
output, |
|
|
size_t |
axis |
|
) |
| |
Initialise the kernel's inputs vector and output.
- Note
- Input and output tensor dimensions preconditions defer depending on the concatenation axis.
- Parameters
-
[in,out] | inputs_vector | The vectors containing all the tensors to concatenate. Data types supported: F16/F32. |
[out] | output | Output tensor. Data types supported: Same as input . |
[in] | axis | Concatenation axis. Supported underlying concatenation axis is 2. |
Definition at line 43 of file GCConcatenateLayer.cpp.
References ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON, arm_compute::auto_init_if_empty(), arm_compute::misc::shape_calculator::calculate_concatenate_shape(), Window::DimZ, ITensor::info(), offset(), and arm_compute::test::validation::output_shape.
47 _num_inputs = inputs_vector.size();
60 for(
unsigned int i = 0; i < _num_inputs; ++i)
62 auto kernel = std::make_unique<GCDepthConcatenateLayerKernel>();
63 kernel->configure(inputs_vector.at(i),
offset, output);
64 offset += inputs_vector.at(i)->info()->dimension(axis);
65 _concat_kernels.emplace_back(std::move(kernel));
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
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...
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
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...
◆ run()
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 74 of file GCConcatenateLayer.cpp.
References GCScheduler::dispatch(), and GCScheduler::get().
76 for(
auto &kernel : _concat_kernels)
void dispatch(IGCKernel &kernel, bool flush=true)
Schedule the execution of the passed kernel if possible.
static GCScheduler & get()
Access the scheduler singleton.
The documentation for this class was generated from the following files: