ttnn.unsqueeze
- ttnn.unsqueeze() None
-
Returns a tensor unsqueezed at the specified dimension
Equivalent pytorch code:
input_tensor = torch.rand((1,1,256), dtype=torch.bfloat16) output_tensor = torch.unsqueeze(input_tensor, 2) # tensor of shape (1,1,1,256), where at dimension 2 we added a new dim of size 1
:param *
input_tensor: Input Tensor. :param *dim: Dim where we want to unsqueeze (add a new dimension of size 1)