Description:
Divides the input tensor into two tensors, x1 and x2, along the last dimension, performs Threshold computation on x1, and multiplies the result by x2.
Formula:
Given an input tensor input with the last dimension length of 2d, the computation proceeds as follows:
- Divide input into two parts:
- Apply the Threshold activation function to x1, defined as: Thus:
- The final output is the element-wise product of x1 and x2:
Each operator has calls. First, aclnnFatreluMulGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnFatreluMul is called to perform computation.
Parameters
[object Object]Returns
[object Object]: status code. For details, see .The first-phase API implements input parameter verification. The following errors may be thrown.
[object Object]
Deterministic computation:
- aclnnFatreluMul defaults to a deterministic implementation.
For typical scenarios where the last dimension is a multiple of 16, if the last dimension is not 32-byte aligned, the small-operator tiling logic is recommended.
The following example is for reference only. For details, see .