Class Activation

Inheritance Relationships

Base Type

  • public mindspore::ops::BaseOperator

Class Documentation

class Activation : public mindspore::ops::BaseOperator

Activation defined Activation operator prototype of lite.

Public Functions

inline Activation()

Constructor.

void Init(const float alpha = 0.2, const float min_val = -1.0, const float max_val = 1.0, const ActivationType &activation_type = NO_ACTIVATION, bool approximate = false)

Method to init the op’s attributes.

Parameters
  • alpha[in] Define a size factor.

  • min_val[in] Define a lower bound.

  • max_val[in] Define a upper bound.

  • activation_type[in] Define the activation type.

  • approximate[in] Define a boolean value to decide whether to use an approximate algorithm, only useful for GELU.

void set_alpha(const float alpha)

Method to set alpha attribute.

Parameters

alpha[in] Define a size factor.

void set_min_val(const float min_val)

Method to set min_val attribute.

Parameters

min_val[in] Define a lower bound.

void set_max_val(const float max_val)

Method to set max_val attribute.

Parameters

max_val[in] Define a upper bound.

void set_activation_type(const ActivationType &activation_type)

Method to set activation type.

Parameters

activation_type[in] Define the activation type.

float get_alpha() const

Method to get alpha attribute.

Returns

alpha attribute.

float get_min_val() const

Method to get min_val attribute.

Returns

min_val attribute.

float get_max_val() const

Method to get max_val attribute.

Returns

max_val attribute.

ActivationType get_activation_type() const

Method to get activation type.

Returns

activation type.

void set_approximate(bool approximate)

Method to set approximate attribute.

Parameters

approximate[in] Define a boolean value to decide whether to use an approximate algorithm, only useful for GELU.

bool get_approximate() const

Method to get approximate attribute.

Returns

approximate attribute.