Compute Library
 19.08
NEUpsampleLayer Class Reference

Function to run upsample layer. More...

#include <NEUpsampleLayer.h>

Collaboration diagram for NEUpsampleLayer:
[legend]

Public Member Functions

 NEUpsampleLayer ()
 Constructor. More...
 
void configure (const ITensor *input, ITensor *output, const Size2D &info, const InterpolationPolicy &policy)
 Set the input output tensors. More...
 
void run () override
 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 (const ITensorInfo *input, const ITensorInfo *output, const Size2D &info, const InterpolationPolicy &policy)
 Static function to check if given info will lead to a valid configuration of NEUpsampleLayer. More...
 

Detailed Description

Function to run upsample layer.

Definition at line 38 of file NEUpsampleLayer.h.

Constructor & Destructor Documentation

◆ NEUpsampleLayer()

Constructor.

Definition at line 30 of file NEUpsampleLayer.cpp.

31  : _kernel(), _data_layout()
32 {
33 }

Member Function Documentation

◆ configure()

void configure ( const ITensor input,
ITensor output,
const Size2D info,
const InterpolationPolicy policy 
)

Set the input output tensors.

Parameters
[in]inputSource tensor. Data types supported: QASYMM8/F16/F32.
[out]outputDestination tensor. Data types supported: same as input.
[in]infoContains stride information described in Size2D.
[in]policyDefines the policy to fill the intermediate pixels.

Definition at line 41 of file NEUpsampleLayer.cpp.

42 {
43  _data_layout = input->info()->data_layout();
44  _kernel.configure(input, output, info, policy);
45 }
void configure(const ITensor *input, ITensor *output, const Size2D &info, const InterpolationPolicy policy)
Set the input output tensors.

References NEUpsampleLayerKernel::configure(), ITensorInfo::data_layout(), ITensor::info(), arm_compute::test::validation::info, and arm_compute::test::validation::policy.

Referenced by arm_compute::test::validation::DATA_TEST_CASE().

◆ run()

void run ( )
overridevirtual

Run the kernels contained in the function.

For NEON kernels:

  • Multi-threading is used for the kernels which are parallelisable.
  • By default std::thread::hardware_concurrency() threads are used.
Note
CPPScheduler::set_num_threads() can be used to manually set the number of threads

For OpenCL kernels:

  • All the kernels are enqueued on the queue associated with CLScheduler.
  • The queue is then flushed.
Note
The function will not block until the kernels are executed. It is the user's responsibility to wait.
Will call prepare() on first run if hasn't been done

Implements IFunction.

Definition at line 47 of file NEUpsampleLayer.cpp.

48 {
49  const auto win = (_data_layout == DataLayout::NCHW) ? Window::DimZ : Window::DimX;
50  NEScheduler::get().schedule(&_kernel, win);
51 }
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
Definition: Window.h:43
Num samples, channels, height, width.
virtual void schedule(ICPPKernel *kernel, const Hints &hints)=0
Runs the kernel in the same thread as the caller synchronously.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
Definition: Window.h:47
static IScheduler & get()
Access the scheduler singleton.
Definition: Scheduler.cpp:96

References Window::DimX, Window::DimZ, Scheduler::get(), arm_compute::NCHW, and IScheduler::schedule().

◆ validate()

Status validate ( const ITensorInfo input,
const ITensorInfo output,
const Size2D info,
const InterpolationPolicy policy 
)
static

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

Parameters
[in]inputSource tensor info. Data types supported: QASYMM8/F16/F32.
[out]outputDestination tensor info. Data types supported: same as input.
[in]infoContains stride information described in Size2D.
[in]policyDefines the policy to fill the intermediate pixels.
Returns
a status

Definition at line 35 of file NEUpsampleLayer.cpp.

37 {
38  return NEUpsampleLayerKernel::validate(input, output, info, policy);
39 }
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const Size2D &info, const InterpolationPolicy policy)
Static function to check if given info will lead to a valid configuration of NEUpsampleLayerKernel.

References arm_compute::test::validation::info, arm_compute::test::validation::policy, and NEUpsampleLayerKernel::validate().


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