Skip to content

Conversation

@fritzo
Copy link
Collaborator

@fritzo fritzo commented May 3, 2018

This replaces two in-place operations +=,-= with non-in-place operations = ... +, = ... - so that small-shaped samples can be scored in TransformedDistributions with large-shaped base distribution parameters. The motivating example is LogNormal:

LogNormal(torch.zeros(2), 1).log_prob(torch.tensor(0.5))  # fails before this PR

Tested

  • added a regression test for LogNormal that also exercises TransformedDistribution

@fritzo
Copy link
Collaborator Author

fritzo commented May 3, 2018

cc @apaszke @alicanb

@ezyang ezyang merged commit 98c24fa into pytorch:master May 4, 2018
Jorghi12 pushed a commit to wsttiger/pytorch that referenced this pull request May 10, 2018
weiyangfb pushed a commit to weiyangfb/pytorch that referenced this pull request Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants