Merge pull request #1090 from hawkinsp/pytree

Fix test failures.
This commit is contained in:
Peter Hawkins 2019-08-01 17:21:20 -04:00 committed by GitHub
commit dce27bfca6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -1109,8 +1109,10 @@ def _device_get(x):
def device_get(x):
for y in tree_leaves(x):
if not isinstance(y, core.Tracer):
try:
y.copy_to_host_async()
except AttributeError:
pass
return tree_map(_device_get, x)

View File

@ -184,7 +184,7 @@ class CoreTest(jtu.JaxTestCase):
try:
tree_multimap(f, xs, ys_bad)
assert False
except TypeError:
except (TypeError, ValueError):
pass
def test_print_jaxpr_compound(self):