tom:

however, no reason to not just use python ints for the crop_d,h,w calculation (as in crop_h_floor = (x.size(3)-height)//2 and crop_h_ceil = crop_h_floor = (x.size(3)-height+1)//2 and then using those in the pad call.


I have fixed it by changed from crop_d.ceil().int()[0] to crop_d.ceil().int()[0].item(). We have to add .item() in the crop_h, crop_d and crop_w. Thanks