def to_gpu(self, device=None): with cuda.get_device(device): super(NegativeSampling, self).to_gpu() self.sampler.to_gpu()