Depending which dimension should be used to calculate the average or mean, you could use:
x = torch.randn(1, 1, 48, 48)
y = x.mean(2) # or .mean(3)
print(y.shape)
y = y.squeeze(1) # or .squeeze(0)
print(y.shape)