FilesLast commitLast update
14 days ago
1 month ago
10 days ago
9 months ago
2 days ago
1 month ago
8 days ago
2 days ago
1 month ago
9 days ago
README

ReduceVar

English | 简体中文

Product Support Status

Product Supported
Ascend 950PR&950DT products √
Atlas A3 products ×
Atlas A2 products ×
Atlas 200I/500 A2 inference products ×
Atlas inference products ×
Atlas training products ×

Function Description

  • Operator function: returns the variance computed from the values of the input tensor in the specified dimension.

  • Computation formula: Assume that dim is ii, and the computation is performed on this dimension. NN is the shape of this dimension. Take selfiself_{i} and compute the mean value xiˉ\bar{x_{i}} on this dimension.

    out=1max(0,N−δN)∑j=0N−1(selfij−xiˉ)2out = \frac{1}{max(0, N - \delta N)}\sum_{j=0}^{N-1}(self_{ij}-\bar{x_{i}})^2

    When unbiased = true, unbiased estimation needs to be added, and δN=1\delta N = 1. When unbiased = false, unbiased estimation needs to be added, and δN=0\delta N = 0; When keepdim = true, the dimension is retained after the reduction, and the value of this dimension in the output shape is 1. When keepdim = false, the dimension is not retained. When dim is nullptr or [], the computation is performed on all dimensions.

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
self Input Input tensor for the ReduceVar computation, which is self in the formula. FLOAT, FLOAT16, BFLOAT16 ND
dim Input Dimension that participates in the Reduce computation, which is i in the formula. INT64 ND
unbiased Input Specifies whether to perform unbiased estimation when computing the variance, which is delta in the formula. BOOL ND
keepdim Input Specifies whether to retain the dimensions of the input tensor in the output tensor. BOOL ND
out Output Output parameter of the ReduceVar computation, which is out in the formula. FLOAT, FLOAT16, BFLOAT16 ND
  • Atlas training products and Atlas inference products: BFLOAT16 is not supported.

Constraint Description

None

Invocation Description

Invocation Method Invocation Sample Description
aclnn invocation test_aclnn_var Invokes the ReduceVar operator through the aclnnVar API.