Description: Takes the input self tensor as a one-dimensional array, uses index to obtain a value from self, and outputs a tensor whose shape is the same as index.
Formula: The subscript i indicates the number of elements traversed from 0 to index minus 1.
Each operator has calls. First, aclnnTakeGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnTake is called to perform computation.
[object Object][object Object]
Parameters:
- self (aclTensor, compute input): target tensor to be converted, self in the formula, aclTensor on the device. are supported. The can be ND. The shape can be greater than eight-dimensional.
- [object Object]Atlas training products[object Object]: The data type can be UINT64, INT64, UINT32, FLOAT32, INT32, UINT16, INT16, FLOAT16, INT8, UINT8, DOUBLE, COMPLEX64, COMPLEX128 or BOOL.
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object], [object Object]Atlas A3 training products/Atlas A3 inference products[object Object], and Ascend 950PR/Ascend 950DT: The data type can be UINT64, INT64, UINT32, FLOAT32, INT32, UINT16, INT16, FLOAT16, BFLOAT16, INT8, UINT8, DOUBLE, COMPLEX64, COMPLEX128 or BOOL.
- index (aclTensor, compute input): aclTensor on the device. The data type can be INT32 or INT64. are supported. The shape is less than or equal to eight-dimensional. The can be ND. Negative indexes are not supported. The value range is from 0 to self.shape[dim] (including 0 and excluding self.shape[dim]).
- out (aclTensor*, compute output): aclTensor on the device. The data type is the same as that of self. The shape is the same as that of index. are supported. The can be ND.
- [object Object]Atlas training products[object Object]: The data type can be UINT64, INT64, UINT32, FLOAT32, INT32, UINT16, INT16, FLOAT16, INT8, UINT8, DOUBLE, COMPLEX64, COMPLEX128 or BOOL.
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object], [object Object]Atlas A3 training products/Atlas A3 inference products[object Object], and Ascend 950PR/Ascend 950DT: The supported data types are UINT64, INT64, UINT32, FLOAT32, INT32, UINT16, INT16, FLOAT16, BFLOAT16, INT8, UINT8, DOUBLE, COMPLEX64, COMPLEX128 and BOOL.
- workspaceSize (uint64_t*, output): size of the workspace required to be allocated on the device.
- executor (aclOpExecutor**, output): operator executor, containing the operator computation process.
- self (aclTensor, compute input): target tensor to be converted, self in the formula, aclTensor on the device. are supported. The can be ND. The shape can be greater than eight-dimensional.
Returns:
[object Object]: 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 aclnnTakeGetWorkspaceSize.
- executor (aclOpExecutor*, input): operator executor, containing the operator computation process.
- stream (aclrtStream, input): stream for executing the task.
Returns:
- Deterministic compute:
- aclnnTake defaults to a deterministic implementation.
The following example is for reference only. For details, see .
[object Object]