A long time ago, PyTorch, here 0.2, didn’t have scalar (0-dimensional) Tensors and so you would have to use tensors of shape [1]. Thus tensors could always act like sequences.
Nowadays, we do have scalar Tensors and these don’t act like sequences.
Likely you want to look more closely at what type of shapes can happen there and why.
Porting from PyTorch 0.2 does take some effort (there also is the Variable/Tensor merge that such code would not know about yet, see the 0.4 migration guide).