| Files | Last commit | Last update |
|---|---|---|
| 8 days ago | ||
| 2 months ago | ||
| 3 days ago | ||
| 18 days ago | ||
| 18 days ago | ||
| 3 days ago | ||
| 8 months ago | ||
| 3 months ago | ||
| 3 days ago | ||
| 1 month ago | ||
| 9 days ago |
ArgMin
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
Returns the indices of the minimum values of a tensor along the specified axis and saves them to out. 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 "aclnnArgMinGetWorkspaceSize" API to obtain the workspace size required for the computation and the executor that contains the operator computation process, and then call the "aclnnArgMin" API to perform the computation.
aclnnStatus aclnnArgMinGetWorkspaceSize(
const aclTensor* self,
int64_t dim,
bool keepdim,
aclTensor* out,
uint64_t* workspaceSize,
aclOpExecutor** executor)
aclnnStatus aclnnArgMin(
void *workspace,
uint64_t workspaceSize,
aclOpExecutor *executor,
aclrtStream stream)
aclnnArgMinGetWorkspaceSize
-
Parameter Description:
Parameter Name Input/Output Description Usage Instructions Data Type Data Format Dimension (shape) Non-contiguous Tensor self Input Input tensor. - FLOAT, FLOAT16, BFLOAT16, DOUBLE, INT8, INT16, INT32, INT64, UINT8 ND - √ dim Input The dimension on which the minimum value is computed. The value range is [-self.dim(), self.dim()). - - - - keepdim Input Specifies whether the dimensions of the output tensor shape are the same as those of the input tensor. - BOOL - - - out Output Output tensor. - INT32, INT64 ND - √ workspaceSize Output Returns the size of the workspace that needs to be allocated on the Device side. - - - - - executor Output Returns the op executor, which contains the operator computation process. - - - - - - Atlas training products: The data type BFLOAT16 is not supported.
- Atlas inference products: The data type BFLOAT16 is not supported. When the input data type of self is INT8, INT16, INT32, INT64, or UINT8, the dimensions of the input tensor shape support a maximum of 7 dimensions.
-
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:
Return Code Error Code Description ACLNN_ERR_PARAM_NULLPTR 161001 The passed-in self or out is a null pointer. ACLNN_ERR_PARAM_INVALID 161002 The data types and data formats of self and out are not within the supported range. The deduced data type cannot be converted to the type of the specified output out. dim exceeds the dimensions of the tensor array. The shape of the passed-in out does not satisfy InferShape.
aclnnArgMin
-
Parameter Description:
Parameter Name Input/Output Description workspace Input The memory address of the workspace allocated on the Device side. workspaceSize Input The size of the workspace allocated on the Device side, obtained by the first-phase API aclnnArgMinGetWorkspaceSize. executor Input The op executor, which contains the operator computation process. stream Input Specifies the Stream that executes tasks. -
Return Values:
aclnnStatus: returns a status code. For details, see aclnn Return Codes.
Constraint Description
-
Deterministic computation:
- aclnnArgMin uses a deterministic implementation by default.
-
For the input self, the scenario where the reduce axis is 0 is not supported
Invocation Description
| Invocation Method | Invocation Sample | Description |
|---|---|---|
| aclnn invocation | test_aclnn_arg_min | Invokes the ArgMin operator through the aclnnArgMin API. |