Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use tf.cond instead of tf.control_flow_ops.cond #1460

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions returnn/tf/util/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3697,7 +3697,7 @@ def debug_register_better_repr():

def cond(pred, true_fn, false_fn, name=None):
"""
This is a wrapper around tf.control_flow_ops.cond().
This is a wrapper around tf.cond().
This will be a branched execution, i.e. either fn1() or fn2() will be executed,
or at least the resulting graph will be evaluated.
If pred can is constant at the call, only the corresponding fn will be called.
Expand Down Expand Up @@ -3727,9 +3727,8 @@ def cond(pred, true_fn, false_fn, name=None):
return true_fn()
else:
return false_fn()
from tensorflow.python.ops import control_flow_ops

return control_flow_ops.cond(pred, true_fn, false_fn, name=name)
return tf.cond(pred, true_fn, false_fn, name=name)


def single_strided_slice(x, axis, begin=None, end=None, step=None):
Expand Down
Loading