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
Loading
Please sign in to comment