(self, weight_dict)
| 27 | |
| 28 | def load(self, weight_dict): |
| 29 | plan = getattr(self, "_block_load_plan", None) |
| 30 | if plan is not None: |
| 31 | return plan.load(self, weight_dict) |
| 32 | for _, module in self._modules.items(): |
| 33 | if hasattr(module, "load"): |
| 34 | module.load(weight_dict) |
| 35 | |
| 36 | for _, parameter in self._parameters.items(): |
| 37 | if hasattr(parameter, "load"): |
| 38 | parameter.load(weight_dict) |
| 39 |