pypto.erfc
Applicable Products
Ascend 950PR/Ascend 950DT: Supported
Atlas A3 training products/Atlas A3 inference products: Supported
Atlas A2 training products/Atlas A2 inference products: Supported
Description
Computes the complementary error function value of each element in the input tensor, element by element. The computation formula is as follows:
Prototype
erfc(input: Tensor) -> TensorParameters
| Parameter | Input/Output | Description |
|---|---|---|
| input | Input | Source operand. Supported data types: DT_FP32, DT_FP16, and DT_BF16. Empty tensors are not supported. The shape supports only 1 to 4 dimensions. The shape size must not exceed 2147483647 (INT32_MAX). |
Return Value
Returns a tensor. Its shape and data type are the same as those of the input tensor, and its elements are the complementary error function values of the corresponding elements of the input tensor.
Constraints
The input tensor and the output tensor must have the same type.
Due to temporary memory usage, the TileShape size has an additional constraint. Assuming the TileShape is [a,b,c,d], then 5*a*b*c*d*sizeof(DT_FP32) < UB.
Tensor inputs do not support the
TileOpFormat.TILEOP_NZformat.
Examples
TileShape Setting Example
Before calling this operation API, set the TileShape through set_vec_tile_shapes.
The TileShape must have the same number of dimensions as the output.
For example, if the input shape is [m, n], the output is [m, n], and the TileShape is set to [m1, n1], then m1 and n1 are used to tile the m and n axes, respectively.
pypto.set_vec_tile_shapes(4, 16)API Call Example
x = pypto.tensor([4], pypto.DT_FP32)
y = pypto.erfc(x)The results are as follows:
Input data x: [0.0, 1.0, 2.0, -1.0]
Output data y: [1.0000, 0.1573, 0.0047, 1.8427]