Skip to content

Commit cbbf888

Browse files
authored
Fix nan gradients in TraceEnum_ELBO when evaluated eagerly (#544)
* fix eager adjoint * fix MarkovProduct * revert sum_product * revert xfail test
1 parent ae99260 commit cbbf888

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

funsor/adjoint.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ def interpret(self, cls, *args):
5858
)
5959
for arg in args
6060
]
61-
self._eager_to_lazy[result] = reflect.interpret(cls, *lazy_args)
61+
with self._old_interpretation:
62+
self._eager_to_lazy[result] = reflect.interpret(cls, *lazy_args)
6263
return result
6364

6465
def __enter__(self):

0 commit comments

Comments
 (0)