- Description: The gated linear unit (GLU) function splits an input tensor evenly into two tensors along the specified dimension dim and multiplies the former tensor by the sigmoid output of the latter tensor element-wise.
- Formula: a and b indicate the former and latter tensors, respectively.
Each operator has calls. First, aclnnGluGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnGlu is called to perform computation.
[object Object]
[object Object]
Parameters
[object Object]- [object Object]Atlas inference products[object Object] and [object Object]Atlas training products[object Object]: The data type can be DOUBLE, FLOAT, or FLOAT16.
Returns
[object Object]: status code. For details, see .The first-phase API implements input parameter validation. The following error codes may be returned.
[object Object]
- Deterministic computation:
- aclnnGlu defaults to a deterministic implementation.
The following example is for reference only. For details, see .
[object Object]