Function: Replicates the input tensor along the number of times specified for each dimension in repeats.
For example, if the input tensor is [[a,b],[c,d],[e,f]], that is, the shape is [3,2] and repeats is (2,4), the shape of the generated tensor is [6,8], and the values are as follows:
[object Object]When
[object Object]is (2,4,2), that is, the number of elements in[object Object]exceeds the dimensions in the tensor, the output tensor is equivalent to the following operation: Expand the shape of the input tensor to the dimension [1,3,2] that is the same as the number of[object Object]; continue to expand the tensor based on the corresponding dimension and the value of[object Object], and the tensor is output as [2,12,4]. The result is as follows:[object Object]The following conditions must be met during computation:
- The number of parameters in repeats cannot be less than the dimensions of the input tensor.
- The value of repeats must be greater than or equal to 0.
Each operator is divided into two functions (see../common/two-stage interface.md). You must call aclnnRepeatGetWorkspaceSize to obtain the workspace size required for computation and the executor that contains the operator computation process, and then call aclnnRepeat to perform computation.
Parameter Description
[object Object]For [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object], the data type does not support HIFLOAT8, FLOAT8_E5M2 or FLOAT8_E4M3FN.
[object Object]Atlas training products[object Object] and [object Object]Atlas inference products[object Object]: The data type cannot be BFLOAT16, HIFLOAT8, FLOAT8_E5M2 or FLOAT8_E4M3FN.
Returns
[object Object]: status code. For details, see .The first-phase API implements input parameter validation. The following error codes may be returned.
[object Object]
- Deterministic computation:
- aclnnRepeat defaults to a deterministic implementation.
The kernel of the internal broadcast of the repeat function supports a maximum of eight dimensions. Currently, the dimensions cannot exceed eight after expansion. The details are as follows: Constraint 1: When the first axis needs to be repeated, a maximum of four dimensions can be repeated at the same time. That is, the number of repeat parameters whose value is not 1 cannot exceed 4.
Constraint 2: When the first axis does not need to be repeated, a maximum of three dimensions can be repeated at the same time. That is, the number of repeat parameters whose value is not 1 cannot exceed 3.
The following example is for reference only. For details, see .