Compute Library
 19.08
GCDropoutLayer Class Reference

Basic function to do dropout op. More...

#include <GCDropoutLayer.h>

Collaboration diagram for GCDropoutLayer:
[legend]

Public Member Functions

 GCDropoutLayer ()
 Constructor. More...
 
void configure (const IGCTensor *input, IGCTensor *mask, IGCTensor *output, float ratio, bool forward)
 Set the input and 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...
 

Detailed Description

Basic function to do dropout op.

This function calls the following kernels:

  1. GCDropoutLayerKernel

Definition at line 38 of file GCDropoutLayer.h.

Constructor & Destructor Documentation

◆ GCDropoutLayer()

Constructor.

Definition at line 33 of file GCDropoutLayer.cpp.

34  : _dropout_kernel()
35 {
36 }

Member Function Documentation

◆ configure()

void configure ( const IGCTensor input,
IGCTensor mask,
IGCTensor output,
float  ratio,
bool  forward 
)

Set the input and output tensors.

Parameters
[in]inputSource tensor. Data type supported: F16/F32.
[out]maskDestination tensor. Data type supported: Same as input.
[out]outputDestination tensor. Data type supported: Same as input.
[in]ratioDropout ratio
[in]forwardForward or backward propagation

Definition at line 38 of file GCDropoutLayer.cpp.

39 {
42 
43  // Configure kernel
44  _dropout_kernel.configure(input, mask, output, ratio, forward);
45 }
#define ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(...)
Definition: Validate.h:543
1 channel, 1 F32 per channel
1 channel, 1 F16 per channel
#define ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
Definition: Validate.h:789
void configure(const IGCTensor *input, IGCTensor *mask, IGCTensor *output, float ratio, bool forward)
Set the input and output of the kernel.

References ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES, GCDropoutLayerKernel::configure(), arm_compute::F16, arm_compute::F32, and arm_compute::test::validation::forward.

◆ 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 GCDropoutLayer.cpp.

48 {
49  GCScheduler::get().dispatch(_dropout_kernel);
50 }
void dispatch(IGCKernel &kernel, bool flush=true)
Schedule the execution of the passed kernel if possible.
Definition: GCScheduler.cpp:69
static GCScheduler & get()
Access the scheduler singleton.
Definition: GCScheduler.cpp:62

References GCScheduler::dispatch(), and GCScheduler::get().


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