# Example 1 ip_tensor = torch.tensor([1, 2, 3, 4]) torch.unsqueeze(ip_tensor, 0) # Output tensor([[1, 2, 3, 4]])