[object Object]

[object Object][object Object]undefined
[object Object]
  • Description:

    The [object Object] function is a variant of the standard ReLU function. It is mainly used to square the output of the ReLU function and is often used as the activation function of a model.

  • Formula:

    yi=(ReLU(xi))2y_i=(ReLU(x_i))^2

    The formula of ReLU is as follows:

    ReLU(xi)=max(0,xi)ReLU(x_i)=max(0,x_i)

    x is the input tensor, y is the output tensor, and i is the index of an element in the tensor.

[object Object]

Each operator has calls. First, aclnnSquaredReluGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnSquaredRelu 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 compute:

    • aclnnSquaredRelu defaults to a deterministic implementation.
  • If the input is NaN, the output is also NaN. If the input is Inf, the output is also Inf.

  • If the input is -Inf, the output is 0.

  • The input shape supports only one to eight dimensions. If the input shape is out of the range, an error is reported.

[object Object]

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

[object Object]