Solved by Luca_Pamparana in post #2 
              
              
                Ok, I figured it out. I needed to convert it to a tensor first. 
shape = torch.tensor(x.shape[2:])
assert torch.sum(shape  % 32) == 0