(module, prefix='')
| 829 | state_dict._metadata = metadata |
| 830 | |
| 831 | def load(module, prefix=''): |
| 832 | local_metadata = {} if metadata is None else metadata.get(prefix[:-1], {}) |
| 833 | module._load_from_state_dict( |
| 834 | state_dict, prefix, local_metadata, True, missing_keys, unexpected_keys, error_msgs) |
| 835 | for name, child in module._modules.items(): |
| 836 | if child is not None: |
| 837 | load(child, prefix + name + '.') |
| 838 | |
| 839 | load(model, prefix='' if hasattr(model, 'bert') else 'bert.') |
| 840 | if len(missing_keys) > 0: |
no outgoing calls
no test coverage detected