FilesLast commitLast update
19 days ago
1 month ago
20 days ago
5 days ago
5 days ago
8 months ago
4 months ago
5 days ago
1 month ago
11 days ago
README

ArgMinWithValue

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 minimum values in self along the specified dimension and their index positions. The minimum values are saved to out, and the indices of the minimum values are saved to indices. If keepdim is false, the corresponding axis is not retained; if keepdim is true, the dimension value of the specified axis is retained as 1.

Function Prototype

  • Each operator is divided into a two-phase API. You must first call the "aclnnMinDimGetWorkspaceSize" API to obtain the workspace size required for the computation and the executor that contains the operator computation process, and then call the "aclnnMinDim" API to perform the computation.

  • aclnnStatus aclnnMinDimGetWorkspaceSize(const aclTensor *self, int64_t dim, bool keepdim, aclTensor *out, aclTensor *indices, uint64_t *workspaceSize, aclOpExecutor **executor)

  • aclnnStatus aclnnMinDim(void *workspace, uint64_t workspaceSize, aclOpExecutor *executor, aclrtStream stream)

aclnnMinDimGetWorkspaceSize

  • Parameter Description:

    • self(aclTensor*, computation input): the target tensor to be converted, which is an aclTensor on the Device side. Its data type is the same as that of out. Supports non-contiguous tensors, and the supported data format is ND. Supports 1 to 8 dimensions.

      • Atlas inference products and Atlas training products: FLOAT, FLOAT16, INT64, and BOOL
      • Atlas A2 products and Atlas A3 products: FLOAT, FLOAT16, INT64, BOOL, and BFLOAT16
      • Ascend 950PR&950DT products: FLOAT, FLOAT16, INT64, BOOL, BFLOAT16, and INT32
    • dim(int64_t, computation input): the specified dimension. The data type is INT64, and the value range is [-self.dim(), self.dim()).

    • keepdim(bool, computation input): specifies whether to retain the dimension of the reduce axis. The data type is BOOL.

    • out(aclTensor*, computation output): an aclTensor on the Device side, and its data type is the same as that of self. Supports non-contiguous tensors, and the supported data format is ND. If keepdim is false, the output dimension is the dimension of self minus 1; if keepdim is true, the output dimension is equal to the dimension of self.

      • Atlas inference products and Atlas training products: FLOAT, FLOAT16, INT64, and BOOL
      • Atlas A2 products and Atlas A3 products: FLOAT, FLOAT16, INT64, BOOL, and BFLOAT16
      • Ascend 950PR&950DT products: FLOAT, FLOAT16, INT64, BOOL, BFLOAT16, and INT32
    • indices(aclTensor*, computation output): an aclTensor on the Device side. The supported data type is INT32. Supports non-contiguous tensors, and the supported data format is ND.

    • workspaceSize(uint64_t*, output parameter): returns the size of the workspace that needs to be allocated on the Device side.

    • executor(aclOpExecutor**, output parameter): returns the op executor, which contains the operator computation process.

  • Return Values:

    aclnnStatus: returns a status code. For details, see aclnn Return Codes.

  The first-phase API completes input parameter validation and reports an error in the following scenarios:
  161001 (ACLNN_ERR_PARAM_NULLPTR): 1. The passed-in self, out, and indices are null pointers.
  161002 (ACLNN_ERR_PARAM_INVALID): 1. The data types of self, out, and indices are not within the supported range.
                                    2. dim exceeds the dimension range of the input self.

aclnnMinDim

  • Parameter Description:

    • workspace(void*, input parameter): the memory address of the workspace allocated on the Device side.

    • workspaceSize(uint64_t, input parameter): the size of the workspace allocated on the Device side, obtained by the first-phase API aclnnMinDimGetWorkspaceSize.

    • executor(aclOpExecutor*, input parameter): the op executor, which contains the operator computation process.

    • stream(aclrtStream, input parameter): specifies the Stream that executes tasks.

  • Return Values:

    aclnnStatus: returns a status code. For details, see aclnn Return Codes.

Constraint Description

  • Deterministic computation:
    • aclnnMinDim uses a deterministic implementation by default.

Invocation Description

Invocation Method Invocation Sample Description
aclnn invocation test_aclnn_min_dim Invokes the ArgMinWithValue operator through the aclnnMinDim API.