Skip to content

Commit

Permalink
Fix dtype compability with numpy 1.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tkerola committed Aug 18, 2017
1 parent 78033d1 commit 2a33245
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion chainer/functions/normalization/batch_renormalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def forward(self, inputs):

if not self.freeze_running_statistics or self.r is None:
if configuration.config.train:
running_sigma = xp.sqrt(self.running_var + self.eps)
running_sigma = xp.sqrt(self.running_var + self.eps,
dtype=self.running_mean.dtype)
self.r = xp.clip(self.std / running_sigma,
1.0 / self.rmax, self.rmax)
self.d = xp.clip((mean - self.running_mean) / running_sigma,
Expand Down

0 comments on commit 2a33245

Please sign in to comment.