kchalk:

I did of course check that none of the values in self.i.[ID] are negative…


I don’t think this error refers to the values in the tensor but rather the vector sizes. I.e, size in terms of .size(). E.g., see
>>> torch.zeros(1, 2, 3)
tensor([[[0., 0., 0.],
         [0., 0., 0.]]])
>>> torch.zeros(1, 2, 3, 0) 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: sizes must be non-negative