How to disable create_graph=True outside the class where this command was used?

I’m reusing a class where sometimes I need a graph to be created while in others I don’t need the graph to be created. I’m wondering if there is any PyTorch function that allows me to disable the command create_graph=True before I call that class without sending a Flag.


I’m afraid create_graph is a boolean argument on the autograd APIs but that’s it :confused: