class_docstr: LayoutConverter is a singleton class which converts the layout of a distributed tensor.
class_docstr_tok: ["LayoutConverter","is","a","singleton","class","which","converts","the","layout","of","a","distributed","tensor","."]
docstr: Get all valid layouts from source_layout with one step transform.
  
  Note:
      all-gather will eliminate a sharding dimension, all-to-all will keep sharding dimension same as before,
      and shard will add a sharding dimension. Therefore, the result of above operations are mutual exclusive,
      we could safely put them together.
  
  Argument:
      source_layout(Layout): the layout to be transformer.
  
  Return:
      valid_spec_dict(Dict[Layout, CommSpec]): all valid layouts from source_layout with one step transform.
docstr_tok: ["Get","all","valid","layouts","from","source_layout","with","one","step","transform",".","Note",":","all-gather","will","eliminate","a","sharding","dimension",",","all-to-all","will","keep","sharding","dimension","same","as","before",",","and","shard","will","add","a","sharding","dimension",".","Therefore",",","the","result","of","above","operations","are","mutual","exclusive",",","we","could","safely","put","them","together",".","Argument",":","source_layout","(","Layout",")",":","the","layout","to","be","transformer",".","Return",":","valid_spec_dict","(","Dict","[","Layout",",","CommSpec","]",")",":","all","valid","layouts","from","source_layout","with","one","step","transform","."]
code: def get_all_one_step_transform_spec(
      self, source_layout: Layout
  ) -> Dict[Layout, CommSpec]:
      """
      Get all valid layouts from source_layout with one step transform.
  
      Note:
          all-gather will eliminate a sharding dimension, all-to-all will keep sharding dimension same as before,
          and shard will add a sharding dimension. Therefore, the result of above operations are mutual exclusive,
          we could safely put them together.
  
      Argument:
          source_layout(Layout): the layout to be transformer.
  
      Return:
          valid_spec_dict(Dict[Layout, CommSpec]): all valid layouts from source_layout with one step transform.
      """
      valid_spec_dict = {}
      valid_spec_dict.update(
          self.all_gather_transform_layouts(source_layout)
      )
      valid_spec_dict.update(
          self.all_to_all_transform_layout(source_layout)
      )
      valid_spec_dict.update(self.shard_transform_layout(source_layout))
      return valid_spec_dict
  
imports: import math
  from copy import deepcopy
  from dataclasses import dataclass
  from typing import Dict, List, Tuple
  import torch
  import torch.distributed
  from colossalai.context.singleton_meta import SingletonMeta
  from colossalai.tensor.d_tensor.comm_spec import *
  from colossalai.tensor.d_tensor.layout import Layout
  from colossalai.tensor.d_tensor.misc import LayoutException
  from colossalai.tensor.utils import all_gather_simulator, all_to_all_simulator, shard_simulator
  from .sharding_spec import ShardingSpec
  from .utils import get_comm_cost
label_desc: Use image node_id 9 for calling the LayoutConverter obj's underlying member method code with example usage: obj.get_all_one_step_transform_spec(source_layout) and returns: valid_spec_dict