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

Update layers pull request #14785

Merged
merged 8 commits into from
Dec 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion tensorflow/contrib/layers/python/layers/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,8 @@ def _delay_updates():
if data_format == DATA_FORMAT_NCHW:
mean = array_ops.reshape(mean, params_shape_broadcast)
variance = array_ops.reshape(variance, params_shape_broadcast)
beta = array_ops.reshape(beta, params_shape_broadcast)
if beta is not None:
beta = array_ops.reshape(beta, params_shape_broadcast)
if gamma is not None:
gamma = array_ops.reshape(gamma, params_shape_broadcast)

Expand Down
6 changes: 6 additions & 0 deletions tensorflow/contrib/layers/python/layers/layers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1739,6 +1739,12 @@ def _addBesselsCorrection(self, sample_size, expected_var):
expected_var *= correction_factor
return expected_var, correction_factor

def testBatchNormCenterFalse(self):
a = array_ops.placeholder(dtype=dtypes.float32, shape=(10, 10, 10, 10))
# Test that center=False builds a valid graph.
_layers.batch_norm(a, center=False, data_format='NCHW',
zero_debias_moving_mean=True)

def testUnknownShape(self):
with ops.Graph().as_default() as g, self.test_session(g):
inputs = array_ops.placeholder(dtype=dtypes.float32)
Expand Down