35 constexpr
int max_input_tensor_dim = 3;
40 : _memory_group(
std::move(memory_manager)), _reduce_func(), _normalize_kernel(), _sumsq()
47 _memory_group.
manage(&_sumsq);
50 const uint32_t actual_axis =
wrap_around(axis, max_input_tensor_dim);
52 _normalize_kernel = std::make_unique<NEL2NormalizeLayerKernel>();
53 _normalize_kernel->configure(input, &_sumsq, output, axis, epsilon);
68 const uint32_t actual_axis =
wrap_around(axis, max_input_tensor_dim);
72 shape.set(actual_axis, 1);
73 sum_sq.set_tensor_shape(
shape);
void run() override
Run the kernels contained in the function.
virtual ITensorInfo & set_tensor_shape(const TensorShape &shape)=0
Set the shape of an already initialized tensor.
void run() override
Run the kernels contained in the function.
~NEL2NormalizeLayer()
Default destructor.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
ITensorInfo & set_data_type(DataType data_type) override
Set the data type to the specified value.
Store the tensor's metadata.
Interface for CPU tensor.
Copyright (c) 2017-2021 Arm Limited.
TensorAllocator * allocator()
Return a pointer to the tensor's allocator.
void manage(IMemoryManageable *obj) override
Sets a object to be managed by the given memory group.
T wrap_around(T x, T m)
Wrap-around a number within the range 0 <= x < m.
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 NEReductionOperation.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
void configure(ITensor *input, ITensor *output, int axis, float epsilon=1e-6f)
Set the input and output tensors.
void allocate() override
Allocate size specified by TensorInfo of CPU memory.
NEL2NormalizeLayer(std::shared_ptr< IMemoryManager > memory_manager=nullptr)
Constructor.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
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 NEL2NormalizeLayerKernel...
Memory group resources scope handling class.
virtual void schedule(ICPPKernel *kernel, const Hints &hints)=0
Runs the kernel in the same thread as the caller synchronously.
static Status validate(const ITensorInfo *input, const ITensorInfo *output, int axis, float epsilon=1e-6f)
Static function to check if given info will lead to a valid configuration of NEL2NormalizeLayer.
Store the tensor's metadata.
void configure(ITensor *input, ITensor *output, unsigned int axis, ReductionOperation op, bool keep_dims=true)
Set the input and output tensors.
static IScheduler & get()
Access the scheduler singleton.