A tensor stores values in a multidimensional array. In image learning, dimensions often describe the batch, channels, height, and width.
For a batch of eight RGB images resized to 224 by 224 pixels, the usual PyTorch shape is (8, 3, 224, 224). A single-channel depth input would normally have shape (8, 1, 224, 224).
import torch
rgb = torch.zeros(8, 3, 224, 224)
depth = torch.zeros(8, 1, 224, 224)
rgbd = torch.cat([rgb, depth], dim=1)
print(rgbd.shape) # torch.Size([8, 4, 224, 224])
Concatenation only aligns array dimensions. It does not register the cameras, convert depth units, or remove invalid depth values. Those steps must be handled before treating the channels as corresponding observations.
Try it
Change the batch size, then inspect every tensor shape. Consider which preprocessing steps are shared between RGB and depth and which require separate handling.