copied.set_param(name, self.get_param(name))
for name, is_allocated in self._grads.items():
if is_allocated:
copied.set_grad(name, self.get_grad(name))
return copied
def to_gpu(self, gpu_id: int) -> None: // pragma: no cover
After Change
for name in self.param_names:
params[name] = self.get_param(name) if self.has_param(name) else None
for name in self.grad_names:
grads[name] = self.get_grad(name)
copied: Model[InT, OutT] = Model(
self.name,
self._func,