Dragon API Dragon v0.3.0 Python enable_grad¶ class dragon.vm.torch.enable_grad[source]¶ Context-manager to enable gradient calculation. Examples: x = torch.ones(2, 3, requires_grad=True) with torch.no_grad(): with torch.enable_grad(): y = x + 1 y.backward() __init__¶ enable_grad.__init__()[source]¶ Create a enable_grad context manager.