def to_gpu(self, device=None): with cuda.get_device(device): super(ChainList, self).to_gpu() for link in self._children: link.to_gpu() return self