PyTorch 1.9 command equivalent for `zero_gradients`
This error comes after the upgrade of my PyTorch version from 1.8 to 1.9.0.
When using this line:
from torch.autograd.gradcheck import zero_gradients, I get this error message: ImportError: cannot import name 'zero_gradients' from 'torch.autograd.gradcheck'
The command:
zero_gradients(im)
is used.
What is the new command equivalent in PyTorch 1.9.0?

There is no function in pytorch named zero_gradients(). The nearest similar name is zero_grad(). It's instead a function defined in the repo you shared in auto-attack/autoattack/other_utils.py .
def zero_gradients(x):
    if isinstance(x, torch.Tensor):
        if x.grad is not None:
            x.grad.detach_()
            x.grad.zero_()
    elif isinstance(x, container_abcs.Iterable):
        for elem in x:
            zero_gradients(elem)

