- Description: Sets the threshold for input x. If elements in x are greater than threshold, the elements are returned. Otherwise, value is returned.
- Formula:
aclnnThreshold and aclnnInplaceThreshold implement the same function in different ways. Select a proper operator based on your requirements. The differences are as follows:
- aclnnThreshold: An output tensor object needs to be created to store the computation result.
- aclnnInplaceThreshold: No output tensor object needs to be created, and the computation result is stored in the memory of the input tensor.
Each operator has calls. First, aclnnThresholdGetWorkspaceSize or aclnnInplaceThresholdGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnThreshold or aclnnInplaceThreshold is called to perform computation.
Parameters
[object Object]- [object Object]Atlas training products[object Object]: The data type cannot be BFLOAT16.
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]- [object Object]Atlas training products[object Object]: The data type cannot be BFLOAT16.
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:
- aclnnThreshold and aclnnInplaceThreshold default to a deterministic implementation.
- If the input is of the INT32 type and the value is not within the range of [–16777216, 16777216], precision error occurs.
The following example is for reference only. For details, see .