Skip to content

module 'torch' has no attribute 'no_grad' #7067

@mll2016

Description

@mll2016

When I am trying the tutorial " Learning PyTorch with Examples" in pytorch ,
with torch.no_grad():
w1 -= learning_rate * w1.grad
w2 -= learning_rate * w2.grad

the following error occured:" module 'torch' has no attribute 'no_grad'". What's the reason?

My environment is : anaconda, Jupiter notebook5.0, pyrhon3.5, pytorch0.3

Thanks

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