Compute Library
 23.11
CpuDequantize Class Reference

Basic function to run kernels::CpuDequantizeKernel that dequantizes an input tensor. More...

#include <CpuDequantize.h>

Collaboration diagram for CpuDequantize:
[legend]

Public Member Functions

void configure (const ITensorInfo *src, ITensorInfo *dst)
 Configure the kernel. More...
 
void run (ITensorPack &tensors) override
 Run the kernels contained in the function. More...
 
- Public Member Functions inherited from INEOperator
 INEOperator (IRuntimeContext *ctx=nullptr)
 Constructor. More...
 
 INEOperator (const INEOperator &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 INEOperator (INEOperator &&)=default
 Default move constructor. More...
 
INEOperatoroperator= (const INEOperator &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
INEOperatoroperator= (INEOperator &&)=default
 Default move assignment operator. More...
 
 ~INEOperator ()
 Default destructor. More...
 
void prepare (ITensorPack &constants) override
 Prepare the function for executing. More...
 
MemoryRequirements workspace () const override
 Return the memory requirements required by the workspace. More...
 
- Public Member Functions inherited from IOperator
virtual ~IOperator ()=default
 Destructor. More...
 

Static Public Member Functions

static Status validate (const ITensorInfo *src, const ITensorInfo *dst)
 Static function to check if given info will lead to a valid configuration. More...
 

Detailed Description

Basic function to run kernels::CpuDequantizeKernel that dequantizes an input tensor.

Definition at line 34 of file CpuDequantize.h.

Member Function Documentation

◆ configure()

void configure ( const ITensorInfo src,
ITensorInfo dst 
)

Configure the kernel.

Parameters
[in]srcSource tensor info. Data types supported: QASYMM8/QASYMM8_SIGNED/QSYMM8_PER_CHANNEL/QSYMM8/QSYMM16.
[out]dstDestination tensor info with the same dimensions of input. Data type supported: F16/F32.

Definition at line 37 of file CpuDequantize.cpp.

38 {
40  auto k = std::make_unique<kernels::CpuDequantizeKernel>();
41  k->configure(src, dst);
42  _kernel = std::move(k);
43 }

References ARM_COMPUTE_LOG_PARAMS, arm_compute::test::validation::dst, and arm_compute::test::validation::src.

Referenced by CpuAddMulAdd::configure().

◆ run()

void run ( ITensorPack tensors)
overridevirtual

Run the kernels contained in the function.

Parameters
[in]tensorsVector that contains the tensors to operate on.

Reimplemented from INEOperator.

Definition at line 50 of file CpuDequantize.cpp.

51 {
52  ARM_COMPUTE_ERROR_ON_MSG(tensors.empty(), "No inputs provided");
53  prepare(tensors);
54  NEScheduler::get().schedule_op(_kernel.get(), Window::DimY, _kernel->window(), tensors);
55 }

References ARM_COMPUTE_ERROR_ON_MSG, Window::DimY, ITensorPack::empty(), Scheduler::get(), INEOperator::prepare(), and IScheduler::schedule_op().

Referenced by CpuAddMulAdd::run().

◆ validate()

Status validate ( const ITensorInfo src,
const ITensorInfo dst 
)
static

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

Similar to CpuDequantize::configure()

Returns
a status

Definition at line 45 of file CpuDequantize.cpp.

46 {
48 }

References arm_compute::test::validation::dst, arm_compute::test::validation::src, and CpuDequantizeKernel::validate().

Referenced by CpuAddMulAdd::validate(), and NEDequantizationLayer::validate().


The documentation for this class was generated from the following files:
arm_compute::test::validation::src
SimpleTensor< float > src
Definition: DFT.cpp:155
arm_compute::IScheduler::schedule_op
virtual void schedule_op(ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors)=0
Runs the kernel in the same thread as the caller synchronously.
arm_compute::test::validation::dst
auto dst
Definition: DFT.cpp:170
ARM_COMPUTE_ERROR_ON_MSG
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
Definition: Error.h:456
arm_compute::Scheduler::get
static IScheduler & get()
Access the scheduler singleton.
Definition: Scheduler.cpp:94
arm_compute::Window::DimY
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
Definition: Window.h:45
arm_compute::experimental::INEOperator::prepare
void prepare(ITensorPack &constants) override
Prepare the function for executing.
Definition: INEOperator.cpp:56
arm_compute::cpu::kernels::CpuDequantizeKernel::validate
static Status validate(const ITensorInfo *src, const ITensorInfo *dst)
Static function to check if given info will lead to a valid configuration.
Definition: CpuDequantizeKernel.cpp:375
ARM_COMPUTE_LOG_PARAMS
#define ARM_COMPUTE_LOG_PARAMS(...)
Definition: Log.h:35