Pytorch forward function. This example is taken verbatim from the PyTo...