Commit 61960288 authored by Skye Wanderman-Milne's avatar Skye Wanderman-Milne Committed by TensorFlower Gardener
Browse files

Make cond_v2 + while_v2 rewrite the forward pass to output needed intermediates.

This is to enable taking the gradient of TF functions nested inside
new control flow. Prior to this change, cond_v2 and while_v2 initially
outputted all intermediates in case they were needed by the gradient
computation. Functions, however, rewrite the forward pass with any
intermediates needed by the gradient when the gradient is
computed. This meant that these intermediates were not initially
available for cond_v2 and while_v2 to output. By making everything
output intermediates on-the-fly, intermediates are available when
needed.

PiperOrigin-RevId: 224222524
parent d224ed8c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment