Skip to content

ImportError: cannot import name 'zero_gradients' from 'torch.autograd.gradcheck' #99

@ashok-arjun

Description

@ashok-arjun

This issue exists because this line:
from advertorch.attacks.utils import zero_gradients

which refers to the zero_gradients function in PyTorch is obsolete.

This is because zero_gradients is removed from PyTorch 1.9. It was present until PyTorch 1.7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions