ttnn.repeat_interleave
- ttnn.repeat_interleave(input_tensor: ttnn.Tensor, repeats: number, dim: number, *, memory_config: ttnn.MemoryConfig = None) ttnn.Tensor
-
Repeats elements of a
tensorin the givendim.- Parameters:
-
input_tensor (ttnn.Tensor) – the input tensor.
repeats (number) – he number of repetitions for each element. repeats is broadcasted to fit the shape of the given axis.
dim (number) – the dimension to expand with the repetitions.
- Keyword Arguments:
-
memory_config (ttnn.MemoryConfig, optional) – Memory configuration for the operation. Defaults to None.
- Returns:
-
ttnn.Tensor – the output tensor.
Example
# Create a tensor to repeat interleave input_tensor = ttnn.rand((10, 10), dtype=ttnn.bfloat16, layout=ttnn.Layout.TILE, device=device) # Repeat interleave the tensor repeated_tensor = ttnn.repeat_interleave(input_tensor, repeats=2, dim=0) logger.info( "Repeat Interleave Tensor Shape:", repeated_tensor.shape ) # Repeat Interleave Tensor Shape: Shape([20, 10])