I am reading a book “Deep learnin with Pytorch” and the code is like below:
print(batch.shape) # torch.Size([4, 3, 256, 256])
batch /= 255.0

n_channels = batch.shape[1]
for c in range(n_channels):
    print("smth.shape", smth.shape)
    mean = torch.mean(batch[:,c])
    std = torch.std(batch[:,c])
    batch[:, c] = (batch[:, c] - mean) / std

I can’t get the intuition of batch[:,c]. It returns torch.Size([4, 256, 256]) where 4 is batch_size, 256 is height and width of an image. : means everything and c is looped over 0, 1 and 2. In the first iteration it will be batch[:,0]. Why is that returning torch.Size([4, 256, 256])?