Skip to content

Commit

Permalink
Fix LocScaleReparam(1.0) (#2863)
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzo authored Jun 8, 2021
1 parent 52084a2 commit 005032f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyro/infer/reparam/loc_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __call__(self, name, fn, obs):
assert obs is None, "LocScaleReparam does not support observe statements"
centered = self.centered
if is_identically_one(centered):
return name, fn, obs
return fn, obs
event_shape = fn.event_shape
fn, event_dim = self._unwrap(fn)

Expand Down
4 changes: 2 additions & 2 deletions tests/infer/reparam/test_loc_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ def model():
expected_probe = get_moments(value)

if "dist_type" == "Normal":
reparam = LocScaleReparam()
reparam = LocScaleReparam(centered)
else:
reparam = LocScaleReparam(shape_params=["df"])
reparam = LocScaleReparam(centered, shape_params=["df"])
reparam_model = poutine.reparam(model, {"x": reparam})
value = poutine.trace(reparam_model).get_trace().nodes["x"]["value"]
actual_probe = get_moments(value)
Expand Down

0 comments on commit 005032f

Please sign in to comment.