Skip to content

Conversation

@fritzo
Copy link
Member

@fritzo fritzo commented Jan 21, 2021

Fixes behavior mismatch blocking pyro-ppl/funsor#427 identified by @eb8680

This makes NumPyro's Transform.inv property act more like PyTorch's.

Tested

  • added a new assertion
  • verified funsor tests pass locally

@fritzo fritzo force-pushed the transform-inv-weakref branch from 08c98b7 to bdf6d77 Compare January 21, 2021 19:30
z = transform.inv(y)
assert_allclose(x, z, atol=1e-6, rtol=1e-6)
assert transform.inv.inv is transform
assert transform.inv is transform.inv
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the fix, @fritzo!

@fritzo fritzo merged commit 7e48b74 into master Jan 21, 2021
@fritzo fritzo deleted the transform-inv-weakref branch January 21, 2021 20:26
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.

3 participants