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 ofrepeats.
Args:
- input_shape (
IndexList[rank]): The shape of the input tensor. - repeats (
TileTensor[type_repeats, Engine=repeats.Engine, address_space=repeats.address_space, linear_idx_type=repeats.linear_idx_type]): A one-dimensional integral tensor of per-element repeat counts, either size 1 or equal toinput_shape[axis]. - axis (
Int): The axis along which elements are repeated.
Returns:
IndexList[rank]: input_shape with the axis dimension updated to the total repeated
size.