Skip to content

Commit

Permalink
fix clip bug in weight_clip.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hillbig committed Feb 14, 2016
1 parent 935364b commit 14eef4c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion weight_clip.py
@@ -1,3 +1,4 @@
import numpy
from chainer import cuda

class WeightClip(object):
Expand Down Expand Up @@ -34,6 +35,6 @@ def __call__(self, opt):
p = param.data
with cuda.get_device(p) as dev:
if int(dev) == -1:
p = numpy.min(self.high, numpy.max(self.low, p))
numpy.clip(p, self.low, self.high)
else:
kernel(self.low, self.high, p)

0 comments on commit 14eef4c

Please sign in to comment.