IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo function

repeat_interleave_shape

def repeat_interleave_shape[rank: Int, type_repeats: DType](input_shape: IndexList[rank], repeats: TileTensor[type_repeats, Engine=repeats.Engine, address_space=repeats.address_space, linear_idx_type=repeats.linear_idx_type], axis: Int) -> IndexList[rank]

Computes the output shape of repeat_interleave for an input of shape input_shape, repeats, and axis.

The returned IndexList is input_shape with the size along axis replaced by the summed repeats values, or by input_shape[axis] multiplied by the single repeat value when repeats is a size-1 broadcast.

Parameters:

  • ​rank (Int): The rank of the input tensor.
  • ​type_repeats (DType): The integral element type of repeats.

Args:

Returns:

IndexList[rank]: input_shape with the axis dimension updated to the total repeated size.

Was this page helpful?