40 constexpr
int max_input_tensor_dim = 3;
44 : _memory_group(std::move(memory_manager)),
64 _memory_group.
manage(&_sumsq);
67 const uint32_t actual_axis =
wrap_around(axis, max_input_tensor_dim);
69 _normalize_kernel->configure(compile_context,
input, &_sumsq, output, axis,
epsilon);
84 const uint32_t actual_axis =
wrap_around(axis, max_input_tensor_dim);
88 shape.set(actual_axis, 1);
89 sum_sq.set_tensor_shape(
shape);
static Status validate(const ITensorInfo *input, const ITensorInfo *output, int axis, float epsilon=1e-12f)
Static function to check if given info will lead to a valid configuration of CLL2NormalizeLayer.
static CLScheduler & get()
Access the scheduler singleton.
virtual ITensorInfo & set_tensor_shape(const TensorShape &shape)=0
Set the shape of an already initialized tensor.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
ITensorInfo & set_data_type(DataType data_type) override
Set the data type to the specified value.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
Store the tensor's metadata.
CLTensorAllocator * allocator()
Return a pointer to the tensor's allocator.
void init(const TensorInfo &input, size_t alignment=0)
Initialize a tensor based on the passed TensorInfo.
Copyright (c) 2017-2021 Arm Limited.
void manage(IMemoryManageable *obj) override
Sets a object to be managed by the given memory group.
CLL2NormalizeLayer(std::shared_ptr< IMemoryManager > memory_manager=nullptr)
Constructor.
Interface to enqueue OpenCL kernels and get/set the OpenCL CommandQueue and ICLTuner.
T wrap_around(T x, T m)
Wrap-around a number within the range 0 <= x < m.
~CLL2NormalizeLayer()
Default Destructor.
void configure(ICLTensor *input, ICLTensor *output, int axis, float epsilon=1e-12f)
Set the input and output tensors.
void run() override
Run the kernels contained in the function.
static Status validate(const ITensorInfo *input, const ITensorInfo *output, unsigned int axis, ReductionOperation op, bool keep_dims=true)
Static function to check if given info will lead to a valid configuration of CLReductionOperation.
void run() override
Run the kernels contained in the function.
void enqueue(ICLKernel &kernel, bool flush=true)
Schedule the execution of the passed kernel if possible.
void allocate() override
Allocate size specified by TensorInfo of OpenCL memory.
Memory group resources scope handling class.
Interface for OpenCL tensor.
Interface for performing a L2 normalize on a given axis given the square sum of it in this axis.
static Status validate(const ITensorInfo *input, const ITensorInfo *sum, const ITensorInfo *output, int axis, float epsilon)
Static function to check if given info will lead to a valid configuration of CLL2NormalizeLayerKernel...
Store the tensor's metadata.
void configure(ICLTensor *input, ICLTensor *output, unsigned int axis, ReductionOperation op, bool keep_dims=true)
Set the input and output tensors.