Returns a dictionary that can be saved or load.
(self)
| 1296 | return self |
| 1297 | |
| 1298 | def state_dict(self) -> T.Dict[str, T.Any]: |
| 1299 | """Returns a dictionary that can be saved or load.""" |
| 1300 | to_save = dict() |
| 1301 | for name in self.attr_names: |
| 1302 | to_save[name] = getattr(self, name, None) |
| 1303 | return to_save |
| 1304 | |
| 1305 | def load_state_dict( |
| 1306 | self, |