Question 2
You have a tensor x = torch.tensor([1, 2, 3, 4]) with shape (4,). You perform the following operations:
stacked_x = torch.stack([x, x, x], dim=0)stacked_y = torch.stack([x, x, x], dim=1)What are the shapes of stacked_x and stacked_y respectively?
(3, 4) and (3, 4)
(3, 4) and (4, 3)
(4, 3) and (4, 3)
(4, 3) and (3, 4)