Description: Extracts elements from the specified dimension dim of the input tensor based on the index number in index, and saves the elements to the out tensor.
Example: Assume that the input tensor x = and the index tensor index = [1, 0].
Result of dim = 0:
Result of dim = 1:
The computation process is as follows: Take a 3D tensor with shape (3, 2, 2) as an example: Assume x = with index = [1, 0], the indices corresponding to dim 0, 1, and 2 are , respectively. index is 1D (if it is 0D, it is considered as a 1D tensor with the size of 1).
dim = 0: I = index[i]; y = x
dim = 1: J = index[j]; y = x
dim = 2: K = index[k]; y = x
Each operator has calls. First, aclnnGatherV2GetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnGatherV2 is called to perform computation.
Parameters
[object Object]- [object Object]Atlas inference products[object Object] and [object Object]Atlas training products[object Object]: The data type cannot be BFLOAT16.
Returns
[object Object]: status code. For details, see .The first-phase API implements input parameter verification. The following errors may be thrown.
[object Object]
- Deterministic computation:
- aclnnGatherV2 defaults to a deterministic implementation.
The following example is for reference only. For details, see .