Compute Library
 21.02
NECast Class Reference

Basic function to run NEDepthConvertLayerKernel. More...

#include <NECast.h>

Collaboration diagram for NECast:
[legend]

Public Member Functions

void configure (ITensor *input, ITensor *output, ConvertPolicy policy)
 Initialize the function's source, destination. More...
 
- Public Member Functions inherited from INESimpleFunctionNoBorder
 INESimpleFunctionNoBorder (IRuntimeContext *ctx=nullptr)
 Constructor. More...
 
 INESimpleFunctionNoBorder (const INESimpleFunctionNoBorder &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 INESimpleFunctionNoBorder (INESimpleFunctionNoBorder &&)=default
 Default move constructor. More...
 
INESimpleFunctionNoBorderoperator= (const INESimpleFunctionNoBorder &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
INESimpleFunctionNoBorderoperator= (INESimpleFunctionNoBorder &&)=default
 Default move assignment operator. More...
 
 ~INESimpleFunctionNoBorder ()
 Default destructor. More...
 
void run () override final
 Run the kernels contained in the function. More...
 
- Public Member Functions inherited from IFunction
virtual ~IFunction ()=default
 Destructor. More...
 
virtual void prepare ()
 Prepare the function for executing. More...
 

Static Public Member Functions

static Status validate (ITensorInfo *input, ITensorInfo *output, ConvertPolicy policy)
 Static function to check if given info will lead to a valid configuration of NECast. More...
 

Detailed Description

Basic function to run NEDepthConvertLayerKernel.

This function ignores the scale and zeroPoint of quanized tensors,so QASYMM8 input is treated as uint8 values.

Definition at line 38 of file NECast.h.

Member Function Documentation

◆ configure()

void configure ( ITensor input,
ITensor output,
ConvertPolicy  policy 
)

Initialize the function's source, destination.

Input data type must be different than output data type.

Valid conversions Input -> Output :

  • QASYMM8_SIGNED -> S16, S32, F32, F16
  • QASYMM8 -> U16, S16, S32, F32, F16
  • U8 -> U16, S16, S32, F32, F16
  • U16 -> U8, U32
  • S16 -> QASYMM8_SIGNED, U8, S32
  • F16 -> QASYMM8_SIGNED, QASYMM8, F32, S32, U8
  • S32 -> QASYMM8_SIGNED, QASYMM8, F16, F32, U8
  • F32 -> QASYMM8_SIGNED, QASYMM8, BFLOAT16, F16, S32, U8
Parameters
[in]inputThe input tensor to convert. Data types supported: QASYMM8_SIGNED/QASYMM8/U8/U16/S16/F16/S32/F32.
[out]outputThe output tensor. Data types supported: QASYMM8_SIGNED/QASYMM8/U8/S8/U16/S16/U32/S32/BFLOAT16/F16/F32.
[in]policyConversion policy.

Definition at line 34 of file NECast.cpp.

35 {
36  auto k = std::make_unique<NEDepthConvertLayerKernel>();
37  k->configure(input, output, policy, 0);
38  _kernel = std::move(k);
39 }

◆ validate()

Status validate ( ITensorInfo input,
ITensorInfo output,
ConvertPolicy  policy 
)
static

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

Parameters
[in]inputSource tensor info. Data types supported: QASYMM8_SIGNED/QASYMM8/U8/U16/S16/F16/S32/F32.
[in]outputDestination tensor info. Data type supported: QASYMM8_SIGNED/QASYMM8/U8/S8/U16/S16/U32/S32/BFLOAT16/F16/F32.
[in]policyConversion policy.
Returns
a status

Definition at line 41 of file NECast.cpp.

References NEDepthConvertLayerKernel::validate().

42 {
43  return NEDepthConvertLayerKernel::validate(input, output, policy, 0);
44 }
static Status validate(const ITensorInfo *input, const ITensorInfo *output, ConvertPolicy policy, uint32_t shift=0)
Static function to check if given info will lead to a valid configuration of NEDepthConvertLayerKerne...

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