24.02.1
|
Go to the documentation of this file.
42 constexpr
int max_input_tensor_dim = 3;
46 : _memory_group(std::move(memory_manager)),
69 _memory_group.
manage(&_sumsq);
72 const uint32_t actual_axis =
wrap_around(axis, max_input_tensor_dim);
74 _normalize_kernel->configure(compile_context,
input, &_sumsq, output, axis,
epsilon);
89 const uint32_t actual_axis =
wrap_around(axis, max_input_tensor_dim);
94 shape.set(actual_axis, 1);
void manage(IMemoryManageable *obj) override
Sets a object to be managed by the given memory group.
void enqueue(ICLKernel &kernel, bool flush=true)
Schedule the execution of the passed kernel if possible.
void init(const TensorInfo &input, size_t alignment=0)
Initialize a tensor based on the passed TensorInfo.
Interface for OpenCL tensor.
ITensorInfo & set_data_type(DataType data_type) override
Set the data type to the specified value.
T wrap_around(T x, T m)
Wrap-around a number within the range 0 <= x < m.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
@ SUM_SQUARE
Sum of squares.
void run() override
Run the kernels contained in the function.
CLL2NormalizeLayer(std::shared_ptr< IMemoryManager > memory_manager=nullptr)
Constructor.
Interface to enqueue OpenCL kernels and get/set the OpenCL CommandQueue and ICLTuner.
void allocate() override
Allocate size specified by TensorInfo of OpenCL memory.
CLTensorAllocator * allocator()
Return a pointer to the tensor's allocator.
static CLScheduler & get()
Access the scheduler singleton.
void configure(ICLTensor *input, ICLTensor *output, int axis, float epsilon=1e-12f)
Set the input and output tensors.
Store the tensor's metadata.
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.
Memory group resources scope handling class.
Copyright (c) 2017-2024 Arm Limited.
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...
void configure(ICLTensor *input, ICLTensor *output, unsigned int axis, ReductionOperation op, bool keep_dims=true)
Set the input and output tensors.
Store the tensor's metadata.
~CLL2NormalizeLayer()
Default Destructor.
ITensorInfo & set_tensor_shape(const TensorShape &shape) override
Set the shape of an already initialized tensor.
#define ARM_COMPUTE_LOG_PARAMS(...)
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 *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.