"{} != {}".format(array.dtype, self.dtype)
if not array.shape: // 0-dim case
backend.copyto(array, numpy.asarray(
self.scale * (2 * int(self.rng.randint(2)) - 1),
dtype=array.dtype))
elif not array.size:
raise ValueError("Array to be initialized must be non-empty.")
After Change
"{} != {}".format(array.dtype, self.dtype)
if not array.shape: // 0-dim case
if self.rng is None:
a = numpy.random.randint(2)
else:
a = self.rng.randint(2)
a = int(a)
array[...] = self.scale * (2 * a - 1)