b85e17830cdbefd3bf70794b27274e9598c2ab74,chainer/initializers/normal.py,Normal,__call__,#Normal#Any#,37

Before Change


        if self.dtype is not None:
            assert array.dtype == self.dtype,\
                "{} != {}".format(array.dtype, self.dtype)
        backend.copyto(array, self.rng.normal(
            loc=0.0, scale=self.scale,
            size=array.shape).astype(array.dtype))


class LeCunNormal(initializer.Initializer):

After Change


        if self.dtype is not None:
            assert array.dtype == self.dtype,\
                "{} != {}".format(array.dtype, self.dtype)
        if self.rng is None:
            device = backend.get_device_from_array(array)
            args = {"loc": 0.0, "scale": self.scale, "size": array.shape}
            if device.xp is cuda.cupy:
                // Only CuPy supports dtype option
                if self.dtype == numpy.float32 or self.dtype == numpy.float16:
                    // float16 is not supported in cuRAND
                    args["dtype"] = numpy.float32
            array[...] = device.xp.random.normal(**args)
        else:
            backend.copyto(array, self.rng.normal(
                loc=0.0, scale=self.scale,
                size=array.shape).astype(array.dtype))


class LeCunNormal(initializer.Initializer):

    Initializes array with scaled Gaussian distribution.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: chainer/chainer
Commit Name: b85e17830cdbefd3bf70794b27274e9598c2ab74
Time: 2019-09-10
Author: nc.jky0@gmail.com
File Name: chainer/initializers/normal.py
Class Name: Normal
Method Name: __call__


Project Name: chainer/chainer
Commit Name: b85e17830cdbefd3bf70794b27274e9598c2ab74
Time: 2019-09-10
Author: nc.jky0@gmail.com
File Name: chainer/initializers/normal.py
Class Name: Normal
Method Name: __call__


Project Name: chainer/chainer
Commit Name: b85e17830cdbefd3bf70794b27274e9598c2ab74
Time: 2019-09-10
Author: nc.jky0@gmail.com
File Name: chainer/initializers/orthogonal.py
Class Name: Orthogonal
Method Name: __call__


Project Name: chainer/chainer
Commit Name: b85e17830cdbefd3bf70794b27274e9598c2ab74
Time: 2019-09-10
Author: nc.jky0@gmail.com
File Name: chainer/initializers/uniform.py
Class Name: Uniform
Method Name: __call__