Skip to content

Commit 4bd101c

Browse files
authored
Merge pull request pkmital#24 from bigsnarfdude/master
refactored modern_convnet.py code for r11
2 parents 5d4125d + ddce2fb commit 4bd101c

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

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
ema_apply_op = ema.apply([batch_mean, batch_var])
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

python/libs/connections.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44
import math
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):
@@ -51,7 +50,7 @@ def mean_var_with_update():
5150
"""
5251
with tf.control_dependencies([ema_apply_op]):
5352
return tf.identity(batch_mean), tf.identity(batch_var)
54-
mean, var = control_flow_ops.cond(phase_train,
53+
mean, var = tf.cond(phase_train,
5554
mean_var_with_update,
5655
lambda: (ema_mean, ema_var))
5756

0 commit comments

Comments
 (0)