Question 1: Short answer
easyAI-checkedPyTorchWhat does the last line print?
import torch
X = torch.arange(12, dtype=torch.float32).reshape(3, 4)
Y = torch.tensor([[2.0, 1, 4, 3], [1, 2, 3, 4], [4, 3, 2, 1]])
print((X < Y).sum().item())1 question from PyTorch
1 question · 1 min · score and explanations at the end
What does the last line print?
import torch
X = torch.arange(12, dtype=torch.float32).reshape(3, 4)
Y = torch.tensor([[2.0, 1, 4, 3], [1, 2, 3, 4], [4, 3, 2, 1]])
print((X < Y).sum().item())