@ptrblck I read in one of your previous posts that the error might come when the input tensor is not contiguous and I make sure that the input is contiguous by calling .contiguous()  on the input tensor. At this point, I have no idea what is possibly wrong here.