def to_cpu(self): super(Chain, self).to_cpu() d = self.__dict__ for name in self._children: d[name].to_cpu() return self