[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Repeats each element in the tensor based on the dim dimension for the corresponding number of times specified by the tensor repeats.

  • Example: Assume that the input tensor is [[a, b], [c, d], [e, f]]. repeats is ([1, 2, 3]), and dim is 0. In this case, the generated tensor is ([[a, b], [c, d], [c, d], [e, f], [e, f], [e, f]]). In the dimension with dim = 0, a and b are repeated once, c and d are repeated twice, and e and f are repeated three times.

    Assume that the input tensor is ([[a, b], [c, d], [e, f]]). repeats is ([2]), and dim is 0. In this case, the generated tensor is [ [a, b], [a, b], [c, d], [c, d], [e, f], [e, f]]. In the dimension with dim = 0, a and b are repeated twice, c and d are repeated twice, and e and f are repeated twice. Note: This scenario is equivalent to repeats being (2).

[object Object]
  • Each operator has calls. First, aclnnRepeatInterleaveWithDimGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnRepeatInterleaveWithDim is called to perform computation.

    • [object Object]
    • [object Object]
[object Object]
  • Parameters:

    • self (aclTensor*, compute input): aclTensor on the device, indicating the input tensor to be copied. Empty tensors and are supported. The can be ND, and the shape supports one to eight dimensions.

      • [object Object]Atlas inference series products[object Object] and [object Object]Atlas training series products[object Object]: The data type can be UINT8, INT8, INT16, INT32, INT64, BOOL, FLOAT16, or FLOAT.
      • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object], [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type can be UINT8, INT8, INT16, INT32, INT64, BOOL, FLOAT16, BFLOAT16, or FLOAT.
    • repeats (aclTensor*, compute input): number of repeats. aclTensor on the device. The data type can be INT32 or INT64. repeats can only be a zero- or one-dimensional tensor. For a one-dimensional tensor, the size of repeats must be 1 or equal to the size of the dim dimension of self. Empty tensors and are supported. The can be ND.

    • dim (int64_t, compute input): dimension for repeats, int64_t type on the host. The value range is [–self.dim(), self.dim() – 1].

    • outputSize (int64_t, compute input): final size of the tensor along the dim dimension after repeats. int64_t type on the host. If repeats contains multiple values, the value of outputSize must be equal to the sum of the values of repeats. If repeats contains only one element, the value of outputSize must be equal to repeats multiplied by the size of the dim dimension of self.

    • out (aclTensor*, compute output): aclTensor on the device, output tensor after data copy is complete. The data type must be the same as that of self. The can be ND. If repeats contains multiple values, the dim size of the out shape is equal to the sum of all elements in repeats. If repeats contains only one element, the dim size of the out shape is equal to repeats multiplied by the size of the dim dimension of self.

      • [object Object]Atlas inference series products[object Object] and [object Object]Atlas training series products[object Object]: The data type can be UINT8, INT8, INT16, INT32, INT64, BOOL, FLOAT16, or FLOAT.
      • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object], [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type can be UINT8, INT8, INT16, INT32, INT64, BOOL, FLOAT16, BFLOAT16, or FLOAT.
    • workspaceSize (uint64_t*, output): size of the workspace to be allocated on the device.

    • executor (aclOpExecutor**, output): operator executor, containing the operator computation process.

  • Returns:

    aclnnStatus: status code. For details, see .

[object Object]
[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 aclnnRepeatInterleaveWithDimGetWorkspaceSize.

    • executor (aclOpExecutor*, input): operator executor, containing the operator computation process.

    • stream (aclrtStream, input): stream for executing the task.

  • Returns:

    aclnnStatus: status code. For details, see .

[object Object]
  • Deterministic compute:
    • aclnnRepeatInterleaveWithDim defaults to a deterministic implementation.

The following conditions must be met during computation:

  • repeats can only be a zero- or one-dimensional tensor. For a one-dimensional tensor, the size of repeats must be 1 or equal to the size of the dim dimension of self. The value in the repeats tensor must be a natural number.

  • The value of outputSize must meet the following conditions: If repeats contains only one element, outputSize = Size of the dim dimension of self × Value of repeats. If repeats contains multiple values, outputSize = Sum of repeats.

[object Object]

The following example is for reference only. For details, see .

[object Object]