def init_random(seed): if seed != 0: if hasattr(chainer.cuda, "cupy"): chainer.cuda.cupy.random.seed(seed) numpy.random.seed(seed)