Hi
All optimizers accept param_groups as argument to construct them.
So you can require the user to provide parameters with two groups called body and ouput in your optimizer init.
That way you know exactly which is which.