ttnn.repeat
- ttnn.repeat(input_tensor: ttnn.Tensor, repeat_dims: number, *, memory_config: ttnn.MemoryConfig | None = None) ttnn.Tensor
-
Returns a new tensor filled with repetition of input
input_tensor
according to number of times specified inshape
.- Parameters:
-
input_tensor (ttnn.Tensor) – the input tensor.
repeat_dims (number) – The number of repetitions for each element.
- Keyword Arguments:
-
memory_config (ttnn.MemoryConfig, optional) – Memory configuration for the operation. Defaults to None.
- Returns:
-
ttnn.Tensor – the output tensor.
Example
>>> tensor = ttnn.repeat(ttnn.from_torch(torch.tensor([[1, 2], [3, 4]]), 2,)), device) >>> print(tensor) tensor([[1, 2], [1, 2], [3, 4], [3, 4]])