I feel your tensor size should be (1,1600).
Assuming it is.
import torch
import random
x = torch.randint(0,200,(1,1600))
x = x.reshape(4,20,20)
for i in range(4):
    x[i]/=random.randint(1,200)
x = x.reshape(4,20,20)

Hope this is what you were looking for.