From 9cc69ca2de1b732f5c9d097c5c0d81a4690424ae Mon Sep 17 00:00:00 2001 From: Matthew Johnson Date: Sun, 21 Mar 2021 19:41:04 -0700 Subject: [PATCH] undo changes to host_callback (not needed anymore) --- jax/experimental/host_callback.py | 2 -- tests/host_callback_test.py | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/jax/experimental/host_callback.py b/jax/experimental/host_callback.py index 961ad1cadd1b..a84a23b0407f 100644 --- a/jax/experimental/host_callback.py +++ b/jax/experimental/host_callback.py @@ -934,7 +934,6 @@ def _outside_call_jvp_rule(primals, tangents, **params): if not params["identity"]: raise NotImplementedError("JVP rule is implemented only for id_tap, not for call.") tangent_instantiated = tuple(map(_instantiate_zeros, primals, tangents)) - tangent_instantiated = tuple(map(ad.replace_float0s, primals, tangent_instantiated)) arg_treedef = params["arg_treedef"] # The argument to the jvp tap is a pair of the tapped primals and tangents @@ -947,7 +946,6 @@ def _outside_call_jvp_rule(primals, tangents, **params): arg_treedef=jvp_arg_treedef, )) out_primals_tapped, out_tangents_tapped = util.split_list(out_all, [len(primals)]) - out_tangents_tapped = map(ad.recast_to_float0, out_primals_tapped, out_tangents_tapped) return tuple(out_primals_tapped), tuple(out_tangents_tapped) diff --git a/tests/host_callback_test.py b/tests/host_callback_test.py index 87934ccff2f6..a0d74caca76f 100644 --- a/tests/host_callback_test.py +++ b/tests/host_callback_test.py @@ -1028,7 +1028,7 @@ def func(x, yint): 2 ) transforms: ['jvp', 'transpose'] what: pair ( 2.00 - 0 )""", testing_stream.output) + False )""", testing_stream.output) testing_stream.reset() def test_tap_vmap(self): @@ -1590,8 +1590,8 @@ def padded_sum(x): ( 3 ) ) ) ( ( [0. 0.1 0.2 0.3 0.4] [0. 0.2 0.4 0.6 0.8] ) - ( ( 0 ) - ( 0 ) ) ) )""", testing_stream.output) + ( ( False ) + ( False ) ) ) )""", testing_stream.output) testing_stream.reset() # Now with JIT