Skip to content

Commit

Permalink
Merge pull request #42 from boscotsang/patch-1
Browse files Browse the repository at this point in the history
Fix batchnormlayer compatibility to TF12
  • Loading branch information
zsdonghao authored Dec 21, 2016
2 parents 37899b3 + a2613a1 commit 0f2ab83
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tensorlayer/layers.py
Original file line number Diff line number Diff line change
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

0 comments on commit 0f2ab83

Please sign in to comment.