ttnn.expand

ttnn.expand() None

Returns a new tensor where singleton dimensions are expanded to a larger side. Unlike torch.expand(), this function is not zero-cost and perform a memory copy to create the expanded tensor. This is due to ttnn.Tensor’s lack of strided tensor support.

:param * input: The tensor to be expanded. :param * output_shape: The desired output shape. :param * memory_config: The memory configuration for the expanded tensor.

Requirements:
like torch.expand:

only size 1 dimensions can be expanded in the output shape -1 or the original shape size can be used to indicate that dimension should not have an expansion The output shape must have the same or higher dimensions than the input shape