Class LayerNormFusion

Inheritance Relationships

Base Type

  • public mindspore::ops::BaseOperator

Class Documentation

class LayerNormFusion : public mindspore::ops::BaseOperator

LayerNormFusion defined LayerNorm operator prototype of lite.

Public Functions

inline LayerNormFusion()

Constructor.

void Init(const int64_t begin_norm_axis = 1, const int64_t begin_params_axis = 1, const float epsilon = 1e-7, const bool elementwise_affine = false)

Method to init the op's attributes.

参数
  • begin_norm_axis[in] Define the first normalization dimension of input.

  • begin_params_axis[in] Define the first parameter dimension.

  • epsilon[in] Define a value added to the denominator for numerical stability.

  • elementwise_affine[in] Define a boolean value to indicate that the operation is element-wise or not.

void set_begin_norm_axis(const int64_t begin_norm_axis)

Set begin_norm_axis.

void set_begin_params_axis(const int64_t begin_params_axis)

Set begin_params_axis.

void set_epsilon(const float epsilon)

Set epsilon.

int64_t get_begin_norm_axis() const

Get begin_norm_axis.

返回

begin_norm_axis.

int64_t get_begin_params_axis() const

Get begin_params_axis.

返回

begin_params_axis.

float get_epsilon() const

Get epsilon.

返回

epsilon.

void set_elementwise_affine(const bool elementwise_affine)

Method to set elementwise_affine attribute.

参数

elementwise_affine[in] Define a boolean value to indicate that the operation is element-wise or not.

bool get_elementwise_affine() const

Method to get elementwise_affine attribute.

返回

a boolean value.