class_docstr: DefaultLoadPlanner that adds multiple features on top of LoadPlanner.
  
  In particular it adds the following:
  
  flatten_state_dict: Handle state_dict with nested dicts
  flatten_sharded_tensors: For FSDP in 2D parallel mode
class_docstr_tok: ["DefaultLoadPlanner","that","adds","multiple","features","on","top","of","LoadPlanner",".","In","particular","it","adds","the","following",":","flatten_state_dict",":","Handle","state_dict","with","nested","dicts","flatten_sharded_tensors",":","For","FSDP","in","2D","parallel","mode"]
docstr: Extension from the planner interface to make it easy to extend the default planner.
docstr_tok: ["Extension","from","the","planner","interface","to","make","it","easy","to","extend","the","default","planner","."]
code: def transform_tensor(self, read_item: ReadItem, tensor: torch.Tensor):
      """Extension from the planner interface to make it easy to extend the default planner."""
      return narrow_tensor_by_index(
          tensor, read_item.dest_offsets, read_item.lengths
      )
  
imports: import dataclasses
  import io
  import logging
  import operator
  from collections import ChainMap
  from functools import reduce
  from typing import Any, cast, Dict, List, Tuple, Union
  import torch
  from torch.distributed._shard._utils import narrow_tensor_by_index
  from torch.distributed._tensor import DTensor
  from torch.distributed.checkpoint._dedup_tensors import dedup_tensors
  from torch.distributed.checkpoint._nested_dict import FLATTEN_MAPPING, flatten_state_dict
  from torch.distributed.checkpoint._sharded_tensor_utils import _flatten_sharded_tensors
  from torch.distributed.checkpoint._traverse import set_element
  from torch.distributed.checkpoint.metadata import BytesStorageMetadata, ChunkStorageMetadata, Metadata, MetadataIndex, STATE_DICT_TYPE, STORAGE_TYPES, TensorStorageMetadata
  from torch.distributed.checkpoint.planner import LoadPlan, LoadPlanner, ReadItem, SavePlan, SavePlanner, WriteItem, WriteItemType
  from torch.distributed.checkpoint.planner_helpers import _create_default_metadata_only_plan, _create_read_items, _create_write_items, _init_state_dict
  from torch.distributed.checkpoint.utils import find_state_dict_object
label_desc: Use image node_id 10 for calling the DefaultLoadPlanner obj's underlying member method code with example usage: obj.transform_tensor(read_item, tensor) and returns: narrow_tensor_by_index