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

fix ctx usage in omt mvn #1049

Merged
merged 1 commit into from Apr 19, 2018

Conversation

Projects
None yet
2 participants
@martinjankowiak
Collaborator

martinjankowiak commented Apr 19, 2018

never write ctx.blah = blah. memory leaks may arise....

return loc + ctx.z
white = loc.new_empty(shape).normal_()
z = torch.matmul(white, scale_tril.t())
ctx.save_for_backward(z, white, scale_tril)

This comment has been minimized.

@fritzo

fritzo Apr 19, 2018

Member

Does this work? I thought you could only save inputs or outputs for backward. (That was certainly the case in PyTorch 0.3)

This comment has been minimized.

@martinjankowiak

martinjankowiak Apr 19, 2018

Collaborator

i wouldn't push a proposed fix if i hadn't tested it

This comment has been minimized.

@fritzo

fritzo Apr 19, 2018

Member

Can we confirm that PyTorch changed behavior before merging this? I.e. locate the PyTorch PR where this behavior changed, or locate discussion about it?

This comment has been minimized.

@martinjankowiak

martinjankowiak Apr 19, 2018

Collaborator

is adnotation #3 helpful?

pytorch/pytorch#1016

This comment has been minimized.

@fritzo

fritzo Apr 19, 2018

Member

It looks like the behavior may have changed in pytorch/pytorch#4786 so I guess this is fine.

@fritzo

fritzo approved these changes Apr 19, 2018

@fritzo fritzo merged commit 039badb into dev Apr 19, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@martinjankowiak martinjankowiak deleted the fixomt branch Apr 25, 2018

neerajprad added a commit to neerajprad/pyro that referenced this pull request May 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment