Commit 81f1d675 authored by Dan Moldovan's avatar Dan Moldovan Committed by TensorFlower Gardener
Browse files

Use a smart constant instead tf.constant -- one that matches the condition...

Use a smart constant instead tf.constant -- one that matches the condition value, in the sense that it will either be a Tensor or a Python value.
This change also required adjusting the way side_effect_guards works, which now will gate only the live symbols. A third change adds the live symbols to expression nodes.

Motivation: pure-side-effects control flow statements are being augmented with a dummy return value (they just return a single scalar). This provides a return value that can be used as control dependency by side_effect_guards. Such dependency necessarily needs to be a tensor, but we don't want to return a tensor unless the if statement is staged to a cond. This CL makes that return value consistent with the statement itself.
PiperOrigin-RevId: 220506051
parent 5b373961
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment