def to_gpu(self, device=None): with cuda.get_device(device): self.LmI_tuple = tuple(map(cuda.to_gpu, self.LmI_tuple))