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:
The formula of ReLU is as follows:
x is the input tensor, y is the output tensor, and i is the index of an element in the tensor.
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.
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 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.
The following example is for reference only. For details, see .