class_docstr: This class is a data structure to keep the content in the index.json file for sharded checkpoint.
  
  Example:
      >>> index = CheckpointIndexFile.from_file('model.index.json')
      >>> index.append_metadata('model_type', 'bert')
      >>> index.append_weight_map('bert.embeddings.word_embeddings.weight', 'model_0001-of-0002.bin')
      >>> index.export('new_index.json')
class_docstr_tok: ["This","class","is","a","data","structure","to","keep","the","content","in","the","index.json","file","for","sharded","checkpoint",".","Example",":",">",">",">","index","=","CheckpointIndexFile.from_file","(","'model.index.json","'",")",">",">",">","index.append_metadata","(","'model_type","'",",","'bert","'",")",">",">",">","index.append_weight_map","(","'bert.embeddings.word_embeddings.weight","'",",","'model_0001-of-0002.bin","'",")",">",">",">","index.export","(","'new_index.json","'",")"]
docstr: Check if the index file contains any distributed tensor. The distributed tensors will be stored in
  `dtensor/module.linear.weight.*.bin` or `dtensor/module.linear.weight.*.safetensors` in the weight map.
  
  Returns:
      bool: True if the index file contains any distributed tensor, False otherwise.
docstr_tok: ["Check","if","the","index","file","contains","any","distributed","tensor",".","The","distributed","tensors","will","be","stored","in","`","dtensor\/module.linear.weight",".","*",".bin","`","or","`","dtensor\/module.linear.weight",".","*",".safetensors","`","in","the","weight","map",".","Returns",":","bool",":","True","if","the","index","file","contains","any","distributed","tensor",",","False","otherwise","."]
code: def contains_dtensor(self):
      """
      Check if the index file contains any distributed tensor. The distributed tensors will be stored in
      `dtensor/module.linear.weight.*.bin` or `dtensor/module.linear.weight.*.safetensors` in the weight map.
  
      Returns:
          bool: True if the index file contains any distributed tensor, False otherwise.
      """
      for value in self.weight_map.values():
          if value.endswith(".*.bin") or value.endswith(
              ".*.safetensors"
          ):
              return True
      return False
  
file_path: colossalai/colossalai/checkpoint_io/index_file.py
imports: import json
  import os
  from collections import OrderedDict
  from pathlib import Path
  from typing import Any, Dict, List, Union
  from .utils import is_dtensor_checkpoint
label_desc: Use image node_id 7 for calling the CheckpointIndexFile obj's underlying member method code with example usage: obj.contains_dtensor() and returns: False, True