Please note that both of the following solutions are wrong in the sense that they create a vector of 800 values for mean while I only expect 3 values since I only have 3 channels (RGB)
image_arr = []

for i in range(len(train_dataset)):
    image_arr.append(to_tensor(train_dataset[i]['image']))
                     
mean = torch.mean(torch.stack(image_arr, dim=0), dim=(0, 1, 2))
std = torch.std(torch.stack(image_arr, dim=0), dim=(0, 1, 2))

mean.shape

and

image_arr = []
for i in range(len(train_dataset)):
       image_arr.append((to_tensor(train_dataset[i]['image'])).cpu().detach().numpy())

means = np.mean(image_arr, axis=(0, 1, 2))
stds = np.std(image_arr, axis=(0, 1, 2))
means.shape