Skip to content

Commit f5609e7

Browse files
authored
refactor for r11
control_flow_ops deprecated
1 parent afbdfe5 commit f5609e7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

python/libs/batch_norm.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44

55
import tensorflow as tf
6-
from tensorflow.python import control_flow_ops
76

87

98
def batch_norm(x, phase_train, scope='bn', affine=True):
@@ -54,7 +53,7 @@ def mean_var_with_update():
5453
"""
5554
with tf.control_dependencies([ema_apply_op]):
5655
return tf.identity(batch_mean), tf.identity(batch_var)
57-
mean, var = control_flow_ops.cond(phase_train,
56+
mean, var = tf.cond(phase_train,
5857
mean_var_with_update,
5958
lambda: (ema_mean, ema_var))
6059

0 commit comments

Comments
 (0)