Introduction
Tensors are like multi-dimensional arrays that store data for machine learning. Creating tensors is the first step to work with data in PyTorch.
When you want to convert a list or array of numbers into a tensor to use in a model.
When you need a tensor filled with zeros to initialize weights or biases.
When you want a tensor filled with ones for masks or initial values.
When you want to create a tensor with random numbers for testing or initialization.