code: def _load_model_state_dict(
      model: nn.Module,
      state_dict: Dict[str, ValueType],
      info: _StateDictInfo,
  ) -> _IncompatibleKeys:
      if not info.handle_model or not state_dict:
          return _IncompatibleKeys({}, {})
  
      for key, _ in model.named_parameters():
          fqns = _get_fqns(model, key)
          fqns_with_ddp_prefix = _get_fqns(
              model, key, skip_ddp_prefix=False
          )
          for fqn, fqn_with_ddp_prefix in zip(
              fqns, fqns_with_ddp_prefix
          ):
              if fqn != fqn_with_ddp_prefix:
                  state_dict[fqn_with_ddp_prefix] = state_dict.pop(fqn)
  
      with info.fsdp_context():
          return cast(
              _IncompatibleKeys,
              _state_dict_fn(model, "load_state_dict")(
                  state_dict=state_dict, strict=info.strict
              ),
          )
  
imports: import contextlib
  import functools
  import gc
  from dataclasses import asdict, dataclass, field
  from itertools import chain
  from typing import Any, Callable, cast, Dict, Iterable, List, no_type_check, Optional, Set, Tuple, Union
  import torch
  import torch.distributed
  import torch.nn
  from torch.distributed._shard.sharded_tensor import ShardedTensor
  from torch.distributed._state_dict_utils import _gather_state_dict, _offload_state_dict_to_cpu
  from torch.distributed._tensor import DTensor
  from torch.distributed.fsdp import FullOptimStateDictConfig, FullStateDictConfig, FullyShardedDataParallel, OptimStateDictConfig, ShardedOptimStateDictConfig, ShardedStateDictConfig, StateDictConfig, StateDictType
  from torch.distributed.fsdp._common_utils import _get_module_fsdp_state_if_fully_sharded_module, FSDP_WRAPPED_MODULE
  from torch.nn.modules.module import _IncompatibleKeys
  from torch.nn.parallel import DistributedDataParallel
label_desc: Use image node_id 7 for calling a global function with example usage: _load_model_state_dict(model, state_dict, info) and returns: _IncompatibleKeys, cast