A tensor is a multidimensional structure for numerical values. Think of it as a container whose shape tells you how its values are arranged. Neural networks use tensors for inputs, weights, and outputs so they can transform whole layers at once instead of processing each node and connection separately. section 9.13
Start with familiar shapes:
- A scalar is one number: a 0D tensor, such as 5. section 9.13
- A vector is a 1D array, such as [2.1, -0.3, 4.7]; a matrix is a 2D grid. section 9.13
- A color image can be a 3D tensor with height, width, and color channels. A batch of images adds a fourth dimension. section 9.13
Reading an image tensor’s shape
An 8×8 grayscale image has one channel and can be represented as a matrix. An 8×8 color image has three channels, giving an 8×8×3 tensor. The extra dimension keeps the red, green, and blue values associated with each pixel. section 12.14
Combining feature maps
A U-Net decoder combines an 8×8×8 tensor from an earlier encoder layer with an upsampled 16×8×8 tensor. Stacking their channels produces a 24×8×8 tensor: the spatial dimensions stay 8×8, while the channel counts add. This gives the decoder both fine image detail and deeper features. section 12.19
Check what each dimension means before combining tensors. The color-image example writes channels last (8×8×3), while the decoder example writes channels first (24×8×8); the numbers alone do not identify the axes. section 12.14 section 12.19
12.42 How skip-connection feature maps are combined with the upsampled feature maps
See how a skip connection combines feature maps with upsampled feature maps in the decoder. section 12.19






