Use one Module to provide loss function for another Module

By the way, I have searched the forums and found some related posts, but not the answer to my question. For example: