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

Fix batchnormlayer compatibility to TF12 #42

Merged
merged 1 commit into from Dec 21, 2016
Merged
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
11 changes: 8 additions & 3 deletions tensorlayer/layers.py
Expand Up @@ -1719,9 +1719,14 @@ def _get_variable(name,
beta = _get_variable('beta',
params_shape,
initializer=beta_init)
gamma = _get_variable('gamma',
params_shape,
initializer=gamma_init)
try: # TF12
gamma = _get_variable('gamma',
params_shape,
initializer=gamma_init())
except: # TF11
gamma = _get_variable('gamma',
params_shape,
initializer=gamma_init)

# trainable=False means : it prevent TF from updating this variable
# from the gradient, we have to update this from the mean computed
Expand Down