Compute Library
 21.08
NEL2NormalizeLayerKernel Class Reference

Interface for performing a L2 normalize on a given axis given the square sum of it in this axis. More...

#include <NEL2NormalizeLayerKernel.h>

Collaboration diagram for NEL2NormalizeLayerKernel:
[legend]

Public Member Functions

const char * name () const override
 Name of the kernel. More...
 
 NEL2NormalizeLayerKernel ()
 Default constructor. More...
 
 NEL2NormalizeLayerKernel (const NEL2NormalizeLayerKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
NEL2NormalizeLayerKerneloperator= (const NEL2NormalizeLayerKernel &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 NEL2NormalizeLayerKernel (NEL2NormalizeLayerKernel &&)=default
 Allow instances of this class to be moved. More...
 
NEL2NormalizeLayerKerneloperator= (NEL2NormalizeLayerKernel &&)=default
 Allow instances of this class to be moved. More...
 
 ~NEL2NormalizeLayerKernel ()=default
 Default destructor. More...
 
void configure (const ITensor *input, const ITensor *sum, ITensor *output, int axis, float epsilon)
 Set the input and output tensors. More...
 
void run (const Window &window, const ThreadInfo &info) override
 Execute the kernel on the passed window. More...
 
- Public Member Functions inherited from ICPPKernel
virtual ~ICPPKernel ()=default
 Default destructor. More...
 
virtual void run_nd (const Window &window, const ThreadInfo &info, const Window &thread_locator)
 legacy compatibility layer for implemantions which do not support thread_locator In these cases we simply narrow the interface down the legacy version More...
 
virtual void run_op (ITensorPack &tensors, const Window &window, const ThreadInfo &info)
 Execute the kernel on the passed window. More...
 
- Public Member Functions inherited from IKernel
 IKernel ()
 Constructor. More...
 
virtual ~IKernel ()=default
 Destructor. More...
 
virtual bool is_parallelisable () const
 Indicates whether or not the kernel is parallelisable. More...
 
virtual BorderSize border_size () const
 The size of the border for that kernel. More...
 
const Windowwindow () const
 The maximum window the kernel can be executed on. More...
 
bool is_window_configured () const
 Function to check if the embedded window of this kernel has been configured. More...
 

Static Public Member Functions

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. More...
 

Detailed Description

Interface for performing a L2 normalize on a given axis given the square sum of it in this axis.

Definition at line 34 of file NEL2NormalizeLayerKernel.h.

Constructor & Destructor Documentation

◆ NEL2NormalizeLayerKernel() [1/3]

Default constructor.

Referenced by NEL2NormalizeLayerKernel::name().

◆ NEL2NormalizeLayerKernel() [2/3]

Prevent instances of this class from being copied (As this class contains pointers)

◆ NEL2NormalizeLayerKernel() [3/3]

Allow instances of this class to be moved.

◆ ~NEL2NormalizeLayerKernel()

Default destructor.

Referenced by NEL2NormalizeLayerKernel::name().

Member Function Documentation

◆ configure()

void configure ( const ITensor input,
const ITensor sum,
ITensor output,
int  axis,
float  epsilon 
)

Set the input and output tensors.

Parameters
[in]inputSource tensor. Data types supported: F16/F32.
[in]sumSum values tensor. Data types supported: same as input. Sum will have the same number of dimensions as input.
[out]outputDestination tensor. Data types and data layouts supported: same as input. Output will have the same number of dimensions as input.
[in]axisAxis along which to reduce. Negative values wrap around. Maximum supported actual reduction axis : 2
[in]epsilonLower bound value for the normalization.

Referenced by NEL2NormalizeLayerKernel::name().

◆ name()

◆ operator=() [1/2]

NEL2NormalizeLayerKernel& operator= ( const NEL2NormalizeLayerKernel )
delete

Prevent instances of this class from being copied (As this class contains pointers)

Referenced by NEL2NormalizeLayerKernel::name().

◆ operator=() [2/2]

Allow instances of this class to be moved.

◆ run()

void run ( const Window window,
const ThreadInfo info 
)
overridevirtual

Execute the kernel on the passed window.

Warning
If is_parallelisable() returns false then the passed window must be equal to window()
Note
The window has to be a region within the window returned by the window() method
The width of the window has to be a multiple of num_elems_processed_per_iteration().
Parameters
[in]windowRegion on which to execute the kernel. (Must be a region of the window returned by window())
[in]infoInfo about executing thread and CPU.

Reimplemented from ICPPKernel.

Referenced by NEL2NormalizeLayerKernel::name().

◆ validate()

static Status validate ( const ITensorInfo input,
const ITensorInfo sum,
const ITensorInfo output,
int  axis,
float  epsilon 
)
static

Static function to check if given info will lead to a valid configuration of NEL2NormalizeLayerKernel.

Parameters
[in]inputSource tensor info. Data types supported: F16/F32.
[in]sumSum values tensor info. Data types supported: same as input. Sum will have the same number of dimensions as input.
[in]outputDestination tensor info. Data types and data layouts supported: same as input. Output will have the same number of dimensions as input.
[in]axisAxis along which to reduce. Negative values wrap around. Maximum supported actual reduction axis : 2
[in]epsilonLower bound value for the normalization.
Returns
a status

Referenced by NEL2NormalizeLayerKernel::name(), and NEL2NormalizeLayer::validate().


The documentation for this class was generated from the following file: