What kind of error do you get, if you call loss.backward() in your closure?
You should always use the direct model call instead of forward() unless there is a reason to avoid hooks being called (which is probably a very unusual use case).