- Description: Performs the addition operation and activates the result.
- Formula:
aclnnAddRelu and aclnnInplaceAddRelu implement the same function. The differences are as follows. Select a proper operator based on the actual scenario.
- aclnnAddRelu: You need to create an output tensor object to store the computation result.
- aclnnInplaceAddRelu: You do not need to create an output tensor object. The computation result is stored in the memory of the input tensor.
Each operator has calls. First, aclnnAddReluGetWorkspaceSize or aclnnInplaceAddReluGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnAddRelu or aclnnInplaceAddRelu is called to perform computation.
[object Object][object Object][object Object][object Object]
Parameters:
[object Object]- For the [object Object]Atlas training products[object Object], the data types of the
[object Object],[object Object],[object Object]and[object Object]parameters do not support BFLOAT16.
- For the [object Object]Atlas training products[object Object], the data types of the
Returns:
[object Object]: status code. For details, see .The first-phase API implements input parameter verification. The following errors may be thrown.
[object Object]
Parameters:
[object Object]- For the [object Object]Atlas training products[object Object], the data types of the
[object Object],[object Object]and[object Object]parameters do not support BFLOAT16.
- For the [object Object]Atlas training products[object Object], the data types of the
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:
- aclnnAddRelu&aclnnInplaceAddRelu defaults to a deterministic implementation.
For the scenario where the data type of selfRef is INT8 and that of other is INT32: The cast operator has a precision issue when converting the INT32 type to the INT8 type (see ). In this scenario, the output result precision cannot be ensured.
The following example is for reference only. For details, see .