FilesLast commitLast update
17 days ago
5 months ago
2 months ago
12 days ago
2 months ago
11 days ago
2 months ago
2 months ago
12 days ago
11 days ago
1 month ago
9 days ago
README

ReduceSumOp

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 sum of each row of the input tensor over the given dimensions.

Parameter Description

  • self (aclTensor*, compute input): aclTensor on the device. The shape supports 0-8 dimensions. Non-contiguous tensors are supported. The supported data format is ND.

    • Atlas inference products and Atlas training products: The data types support FLOAT16, FLOAT32, INT8, INT16, INT32, INT64, UINT8, BOOL, DOUBLE, COMPLEX64, and COMPLEX128. When the input is an empty tensor, the output type cannot be the complex types COMPLEX64 and COMPLEX128.
    • Atlas A2 products, Atlas A3 products, and Ascend 950PR&950DT products: The data types support FLOAT16, FLOAT32, INT8, INT16, INT32, INT64, UINT8, BOOL, DOUBLE, COMPLEX64, COMPLEX128, and BFLOAT16. When the input is an empty tensor, the output type cannot be the complex types COMPLEX64 and COMPLEX128.
  • dims (aclIntArray*, compute input): aclIntArray on the host. It specifies the reduce dimensions. The data type supports INT64, and the value range is [-self.dim(), self.dim()-1].

  • keepDims (bool, compute input): BOOL value on the host. It specifies whether to retain the dimensions of the input tensor in the output tensor.

  • dtype (aclDataType, compute input): aclDataType on the device. It specifies the data type of the output tensor.

    • Atlas inference products and Atlas training products: The data types support FLOAT16, FLOAT32, INT8, INT16, INT32, INT64, UINT8, BOOL, DOUBLE, COMPLEX64, and COMPLEX128.
    • Atlas A2 products, Atlas A3 products, and Ascend 950PR&950DT products: The data types support FLOAT16, FLOAT32, INT8, INT16, INT32, INT64, UINT8, BOOL, DOUBLE, COMPLEX64, COMPLEX128, and BFLOAT16.
  • out (aclTensor*, compute output): aclTensor on the device. Non-contiguous tensors are supported. The supported data format is ND.

    • Atlas inference products and Atlas training products: The data types support FLOAT16, FLOAT32, INT8, INT16, INT32, INT64, UINT8, BOOL, DOUBLE, COMPLEX64, and COMPLEX128.
    • Atlas A2 products, Atlas A3 products, and Ascend 950PR&950DT products: The data types support FLOAT16, FLOAT32, INT8, INT16, INT32, INT64, UINT8, BOOL, DOUBLE, COMPLEX64, COMPLEX128, and BFLOAT16.

Constraint Description

  • Deterministic computation:
    • Deterministic implementation by default.

Invocation Example

Invocation Method Sample Code Description
aclnn invocation test_aclnn_reduce_sum Invokes the ReduceSum operator through the aclnnReduceSum API.
Graph-mode invocation test_geir_reduce_sum.cpp Invokes the ReduceSum operator through the GE IR graph mode.