Shortcuts

torch.is_grad_enabled

torch.is_grad_enabled()

如果当前启用了梯度模式,则返回 True。

优云智算