Description: Returns the kth minimum value and index of the input tensor in the specified dimension.
Each operator has calls. First, aclnnKthvalueGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnKthvalue is called to perform computation.
[object Object][object Object]
Parameters:
- self (aclTensor*, compute input): aclTensor on the device. The shape supports 1 to 8 dimensions. are supported, and the supports ND.
- [object Object]Atlas inference series products[object Object] and [object Object]Atlas training series products[object Object]: The data type can be FLOAT16, FLOAT32, INT8, INT16, INT32, INT64, or UINT8.
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type can be BFLOAT16, FLOAT16, FLOAT32, INT8, INT16, INT32, INT64, or UINT8.
- k (int64_t, compute input): integer on the host. It indicates the kth minimum value in a specified dimension. The value range is [0, self.size(dim)].
- dim (int64_t, compute input): integer on the host. It indicates the specified dimension of the input tensor. The value range is [-self.dim(), self.dim()).
- keepdim (bool, compute input): bool type, indicating whether dim is retained in the output tensor. True indicates that the sizes of valuesOut and indicesOut tensors are the same as those of self. False indicates that dimension will be compressed and the obtained tensor dimension is 1 less than that of input.
- valuesOut (aclTensor*, compute output): aclTensor on the device. The data type is the same as that of self. are supported, and the supports ND. The shape sorting axis is 1, and the non-sorting axis is the same as that of self.
- [object Object]Atlas inference series products[object Object] and [object Object]Atlas training series products[object Object]: The data type can be FLOAT16, FLOAT32, INT8, INT16, INT32, INT64, or UINT8.
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type can be BFLOAT16, FLOAT16, FLOAT32, INT8, INT16, INT32, INT64, or UINT8.
- indicesOut (aclTensor*, compute output): aclTensor on the device. The data type can be INT64. It indicates the index of the kth minimum value along the dimension dim in the original input tensor. are supported, and the supports ND. The shape sorting axis is 1, and the non-sorting axis is the same as that of self.
- workspaceSize (uint64_t*, output): size of the workspace to be allocated on the device.
- executor (aclOpExecutor**, output): operator executor, containing the operator computation process.
- self (aclTensor*, compute input): aclTensor on the device. The shape supports 1 to 8 dimensions. are supported, and the supports ND.
Returns:
aclnnStatus: status code. For details, see .
[object Object]
Parameters:
- workspace (void*, input): address of the workspace to be allocated on the device.
- workspaceSize (uint64_t, input): size of the workspace to be allocated on the device, which is obtained by the first-phase API aclnnKthvalueGetWorkspaceSize.
- executor (aclOpExecutor*, input): operator executor, containing the operator computation process.
- stream (aclrtStream, input): stream for executing the task.
Returns:
- Deterministic compute:
- aclnnKthvalue defaults to a deterministic implementation.
The following example is for reference only. For details, see .
[object Object]