Your First torch.tensor
Create a tensor and print its shape and dtype.
Meet the Tensor
A tensor is PyTorch's core data container, a grid of numbers much like a NumPy array but ready to run on a GPU. 🧮
Create One from a List
The simplest way to make a tensor is torch.tensor from a Python list. PyTorch copies your numbers into a fast numerical grid.
x = torch.tensor([1, 2, 3])