After training the model, you can redefine the forward function to return only f_nac. You can use “types” library to redefine the member functions of an existing object. Is this what you are looking for?