Skip to content

Commit

Permalink
Enforce autograph=False on gradient function.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 587754205
  • Loading branch information
shaobohou authored and TF2JAXDev committed Dec 4, 2023
1 parent c3fce27 commit 268b7dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tf2jax/_src/tf2jax.py
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ def _convert_gradient_function(
library[grad_fn_name] = None
return

@tf.function
@tf.function(autograph=False)
def tf_grad_fn(*grad_args, **grad_kwargs):
fn = tf_ops.gradient_registry.lookup(grad_fn_name)
return fn(None, *grad_args, **grad_kwargs)
Expand Down

0 comments on commit 268b7dc

Please sign in to comment.