class_docstr: The wrapped model type returned from [`FairScaleFsdpWrappedModel.wrap_model`](#wrap_model).
class_docstr_tok: ["The","wrapped","model","type","returned","from","[","`","FairScaleFsdpWrappedModel.wrap_model","`","]","(","#","wrap_model",")","."]
code: def consolidate_sharded_state(
      sharded_state_files: Sequence[Union[str, os.PathLike]]
  ) -> StateDictType:
      shard_weights: List[StateDictType] = []
      shard_metadata: List[Dict[str, Any]] = []
      for path in sharded_state_files:
          shard_state = torch.load(path, map_location="cpu")
          shard_weights.append(shard_state["weights"])
          shard_metadata.append(shard_state["metadata"])
      return _FSDP.consolidate_shard_weights(
          shard_weights, shard_metadata
      )
  
imports: import os
  from typing import Tuple, Union, Optional, TYPE_CHECKING, List, Any, Dict, Sequence
  from fairscale.nn import FullyShardedDataParallel
  from fairscale.nn.wrap import enable_wrap, wrap
  from fairscale.nn.misc import FlattenParamsWrapper
  from fairscale.optim.grad_scaler import GradScaler
  import torch
  from torch.cuda import amp
  from allennlp.nn.parallel.sharded_module_mixin import ShardedModuleMixin
  from allennlp.nn.parallel.ddp_accelerator import DdpAccelerator, DdpWrappedModel, StateDictType, LoadStateDictReturnType
label_desc: Use image node_id 1 for calling the FairScaleFsdpWrappedModel obj's underlying member method code with example usage: obj.consolidate_sharded_state(sharded_state_files) and returns: _FSDP