Class LayerNormFusion

Inheritance Relationships

Base Type

  • public LayerNorm

Class Documentation

class LayerNormFusion : public LayerNorm

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.

Parameters
  • 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_elementwise_affine(const bool elementwise_affine)

Method to set elementwise_affine attribute.

Parameters

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.

Returns

a boolean value.