A vector is a one-dimensional tensor: an ordered list of values such as [1.9, 2.6, 3.1]. It commonly represents one datapoint or a model input, with each value corresponding to a feature. Its shape is written [d] when it contains d features. section 1.2
Vector input to a linear model
In PyTorch, torch.tensor([1, 2, 3, 4]) creates a vector with shape torch.Size([4]). For a linear model, x contains d features, and nn.Linear(d, C) maps those features to C outputs through a weight matrix and an implicit bias. section 1.2 section 2.1.5
Figure 1.4 Examples of tensors, with more dimensions or axes as we move from left to right. A scalar represents a single value. A vector is a list of values and is how we often think about one datapoint. A matrix is a grid of values and is often used for a dataset. A three-dimensional tensor can be used to represent a dataset of sequences.
Compare a scalar, vector, matrix, and higher-dimensional tensor to see how added axes change the data structure. section 1.2














































