Compute Library
 22.05
linear< T, S > Struct Template Reference

Linear activation object. More...

#include <NEActivationFunctionDetail.h>

Public Types

using ExactType = typename wrapper::traits::neon_vector< T, S >::type
 SIMD vector type. More...
 
using ExactTagType = typename wrapper::traits::neon_vector< T, S >::tag_type
 SIMD vector tag type. More...
 

Public Member Functions

 linear (ActivationLayerInfo act_info)
 Construct a Linear activation object. More...
 
void operator() (ExactType &vval)
 Run activation function. More...
 
void operator() (T &val)
 Run activation function. More...
 

Data Fields

const T alpha
 Scalar alpha. More...
 
const T beta
 Scalar alpha. More...
 
const ExactType valpha
 Vector of alphas. More...
 
const ExactType vbeta
 Vector of betas. More...
 

Detailed Description

template<typename T, int S>
struct arm_compute::detail::linear< T, S >

Linear activation object.

Definition at line 69 of file NEActivationFunctionDetail.h.

Member Typedef Documentation

◆ ExactTagType

using ExactTagType = typename wrapper::traits::neon_vector<T, S>::tag_type

SIMD vector tag type.

Definition at line 74 of file NEActivationFunctionDetail.h.

◆ ExactType

using ExactType = typename wrapper::traits::neon_vector<T, S>::type

SIMD vector type.

Definition at line 72 of file NEActivationFunctionDetail.h.

Constructor & Destructor Documentation

◆ linear()

linear ( ActivationLayerInfo  act_info)
inlineexplicit

Construct a Linear activation object.

Parameters
[in]act_infoActivation layer information.

Definition at line 80 of file NEActivationFunctionDetail.h.

References arm_compute::wrapper::vdup_n().

81  : alpha(act_info.a()),
82  beta(act_info.b()),
83  valpha(wrapper::vdup_n(static_cast<T>(alpha), ExactTagType{})),
84  vbeta(wrapper::vdup_n(static_cast<T>(beta), ExactTagType{}))
85  {
86  }
typename wrapper::traits::neon_vector< T, S >::tag_type ExactTagType
SIMD vector tag type.
const ExactType valpha
Vector of alphas.
const ExactType vbeta
Vector of betas.
uint8x8_t vdup_n(uint8_t value, traits::vector_64_tag)
Definition: dup_n.h:41

Member Function Documentation

◆ operator()() [1/2]

void operator() ( ExactType vval)
inline

Run activation function.

Parameters
[in]vvalVector of values.

Definition at line 92 of file NEActivationFunctionDetail.h.

References arm_compute::wrapper::vmla().

93  {
94  vval = wrapper::vmla(vbeta, vval, valpha);
95  }
const ExactType valpha
Vector of alphas.
const ExactType vbeta
Vector of betas.
uint8x8_t vmla(const uint8x8_t &a, const uint8x8_t &b, const uint8x8_t &c)
Definition: mla.h:46

◆ operator()() [2/2]

void operator() ( T &  val)
inline

Run activation function.

Parameters
[in]valScalar value.

Definition at line 101 of file NEActivationFunctionDetail.h.

102  {
103  val = alpha * val + beta;
104  }

Field Documentation

◆ alpha

const T alpha

Scalar alpha.

Definition at line 106 of file NEActivationFunctionDetail.h.

◆ beta

const T beta

Scalar alpha.

Definition at line 107 of file NEActivationFunctionDetail.h.

◆ valpha

const ExactType valpha

Vector of alphas.

Definition at line 108 of file NEActivationFunctionDetail.h.

◆ vbeta

const ExactType vbeta

Vector of betas.

Definition at line 109 of file NEActivationFunctionDetail.h.


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