But I’m not only passing my input into pytorch layers. I also have a customer parameter alpha that I use to combine my input with an output of a linear layer: alpha*input + (1-alpha)*output. I have other custom behavior like that too.
In that case, would I have to manually loop over the input batch and build the new tensor after doing my custom computations on each item of the batch? Or is there a better way to do these sorts of things?