r""" Saves the current parameters for restoring later. Args: parameters: Iterable of `torch.nn.Parameter`. The parameters to be temporarily stored.
(self, parameters: Iterable[torch.nn.Parameter])
| 821 | } |
| 822 | |
| 823 | def store(self, parameters: Iterable[torch.nn.Parameter]) -> None: |
| 824 | r""" |
| 825 | Saves the current parameters for restoring later. |
| 826 | |
| 827 | Args: |
| 828 | parameters: Iterable of `torch.nn.Parameter`. The parameters to be temporarily stored. |
| 829 | """ |
| 830 | self.temp_stored_params = [param.detach().cpu().clone() for param in parameters] |
| 831 | |
| 832 | def restore(self, parameters: Iterable[torch.nn.Parameter]) -> None: |
| 833 | r""" |
no outgoing calls