Working with PyTorch tensors
Throughout most of this book, the focus will be on the features provided by the fastai framework. However, some of the solutions that we'll review also exploit general Python libraries (such as the pandas
library for deep learning applications with tabular data) as well as aspects of PyTorch, the low-level deep learning framework upon which fastai is built. To give you a small taste of PyTorch, in this section we'll go through some basic examples of using tensors, the PyTorch structure for multidimensional matrices.
Getting ready
If you are already familiar with NumPy arrays, then you will have a good basis for examining PyTorch tensors because tensors play much the same role for PyTorch as NumPy arrays do for general-purpose Python applications. If you are not familiar with NumPy arrays or it's been a while since you have had a chance to use them, take a bit of time to review them—for example, by going through this tutorial...