FilesLast commitLast update
23 days ago
4 months ago
18 days ago
8 days ago
1 month ago
2 months ago
1 month ago
1 month ago
17 days ago
README

Glu

English | 简体中文

Applicable Products

Product Support
Ascend 950PR&950DT products √
Atlas A3 products √
Atlas A2 products √
Atlas 200I/500 A2 inference products ×
Atlas inference products ×
Atlas training products ×

Function

  • Description: GLU is a gated linear unit function. It evenly splits the input tensor along the specified dimension dim into two tensors, and elementwise multiplies the front-half tensor by the result of the Sigmoid function on the back-half tensor.

  • Formula:

    GLU(a,b)=a⊗σ(b)GLU(a,b)=a \otimes \sigma(b)

    a denotes the front-half tensor after the input tensor is evenly split along the specified dim, and b denotes the back-half tensor.

Parameters

Parameter name Input/Output/Attribute Description Data type Data format
x Input Inputs a tensor. DT_BF16, FLOAT16, DT_FLOAT ND
self Input Input parameter for the GLU computation. The input tensor is evenly split along the specified dimension dim into the two tensors a and b in the formula. DOUBLE, FLOAT, FLOAT16, BFLOAT16 ND
dim Input Denotes the dimension along which the input self is split. INT64 -
out Output Output parameter of the computation. DOUBLE, FLOAT, FLOAT16, BFLOAT16 ND

Constraints

None

Invocation Description

Invocation method Invocation sample Description
aclnn invocation test_aclnn_glu Calls the GLU operator through the aclnnGlu interface.