In my forward function, the first step is a featurization which looks like this:
x = torch.stack([
       torch.sqrt(torch.sum(torch.square(r[j] - r[i])))
       for (i, j) in self.pairs
       ]).reshape(1, -1)

where self.pairs is a Tuple[Tuple[int]] (I’m not sure how to write that properly for type hints.)
Another example that has me stumped is a growing list of tensors.  Occasionally, during some forward steps, this list will have a tensor appended to it.  This list is used during calls to forward.
Lastly, I have constants.  For these, it appears I want nn.Parameter(param, requires_grad=False)
Is it true that these kinds of features weren’t intended to be used in a nn.Module?  I might be missing something bigger.  Thanks for your help!