Skip to main content

Mojo function

repeat_interleave

repeat_interleave[dtype: DType, type_repeats: DType](input: TileTensor[dtype, input.LayoutType, input.origin, address_space=input.address_space, linear_idx_type=input.linear_idx_type, element_size=input.element_size], repeats: TileTensor[type_repeats, repeats.LayoutType, repeats.origin, address_space=repeats.address_space, linear_idx_type=repeats.linear_idx_type, element_size=repeats.element_size], axis: Int, output: TileTensor[dtype, output.LayoutType, output.origin, address_space=output.address_space, linear_idx_type=output.linear_idx_type, element_size=output.element_size])

Fill output by repeating values from input along axis based on the values in repeats buffer.

This is intended to implement the same functionality as torch.repeat: https://pytorch.org/docs/stable/generated/torch.repeat_interleave.html

Args:

  • ​input (TileTensor): The input buffer.
  • ​repeats (TileTensor): The number of repetitions each element in input.
  • ​axis (Int): The axis along which to repeat values.
  • ​output (TileTensor): The output buffer.

Was this page helpful?