Does the optimizer_object anyhow depends upon the Loss_object, except that it wants loss.backward() to be computed before the optimizer.step()?


I am creating a custom_Loss_object every batch iteration (and pass it a parameter). Does it effects optimizer anyhow as compared to when I create the custom_Loss_object only once (before iteration loop) and use it in every iteration?


(I guess no for both the questions.)