Solved by Apurv25 in post #13 
              
              
                For anyone else stuck with similar problem, the reason input of variable size doesn’t work is because torch.stack will fail for inputs of varying size. Their is also a github issue in this regard. One way to work with such input is to write custom collate function. For example, see below. 
def colla…