Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module will ignore params with requires_grad=False #1779

Merged
merged 3 commits into from Mar 1, 2019

Conversation

jpchen
Copy link
Member

@jpchen jpchen commented Mar 1, 2019

Addresses #1778

fritzo
fritzo previously approved these changes Mar 1, 2019
Copy link
Member

@neerajprad neerajprad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

def forward(self, s):
pass

with warnings.catch_warnings():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I would suggest changing this to with pytest.warns(RuntimeWarning): which will explicitly check that this warning is raised.

if param_value._cdata != returned_param._cdata:
target_state_dict[param_name] = returned_param
else:
warnings.warn("{} was not registered in the param store because".format(param_name) +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space between because and requires_grad in the warning message.

neerajprad
neerajprad previously approved these changes Mar 1, 2019
@neerajprad
Copy link
Member

The ss-vae example seems to be failing for some reason, but it doesn't seem related.

@neerajprad neerajprad merged commit 3a4b64a into dev Mar 1, 2019
@jpchen jpchen deleted the requires_grad_false branch March 18, 2019 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants