[object Object]

[object Object][object Object]undefined
[object Object]
  • 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:

    1. Divide input into two parts:x1=input[...,:d],x2=input[...,d:]x_1 = \text{input}[..., :d], \quad x_2 = \text{input}[..., d:]
    2. Apply the Threshold activation function to x1, defined as:Threshold(x,threshold)={0if x<thresholdxif xthreshold\text{Threshold}(x, \text{threshold}) = \begin{cases} 0 & \text{if } x < \text{threshold} \\ x & \text{if } x \geq \text{threshold} \end{cases} Thus:x1=Threshold(x1,threshold)x_1 = \text{Threshold}(x_1, \text{threshold})
    3. The final output is the element-wise product of x1 and x2:out=x1×x2\text{out} = x_1 \times x_2
[object Object]

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.

[object Object]
[object Object]
[object Object]
  • 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]
[object Object]
  • Parameters

    [object Object]
  • Returns

    [object Object]: status code. For details, see .

[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.

[object Object]

The following example is for reference only. For details, see .

[object Object]