Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

Commit

Permalink
Make output of fn in @recompute_grad a list to avoid trying to concat…
Browse files Browse the repository at this point in the history
… tuple and list

PiperOrigin-RevId: 169632380
  • Loading branch information
Ryan Sepassi committed Sep 22, 2017
1 parent 6237729 commit 76706ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tensor2tensor/layers/rev_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def _recompute_grad(fn, args):
def grad_fn(inputs, variables, outputs, output_grads):
del outputs
# recompute outputs
outputs = fn(*inputs)
outputs = list(fn(*inputs))
grads = tf.gradients(outputs, inputs + variables, output_grads)
grad_inputs = grads[:len(inputs)]
grad_vars = grads[len(inputs):]
Expand Down

0 comments on commit 76706ef

Please sign in to comment.