class_docstr: Sharding spec for a tensor, it contains info of the logical device mesh this tensor belong
  to, the entire shape of the tensor before sharded, and the sharding sequence looks like
  [R, R, S0, S1].
  
  Argument:
      device_mesh(DeviceMesh): A logical view of a physical mesh.
      entire_shape(torch.Size): The entire shape of tensor before sharded.
      dim_partition_dict(Dict[int, List[int]]， optional): The key is the dimension of tensor to be sharded,
          and the value of the key describe which logical axis will be sharded in that dimension.
      sharding_sequence(List[_DimSpec], optional): A straight view of ShardingSpec looks like [R, R, S0, S1].
docstr: Convert sharding_sequence into dim_partition_dict.
docstr_tok: ["Convert","sharding_sequence","into","dim_partition_dict","."]
code: def convert_shard_sequence_to_dict(self):
      """
      Convert sharding_sequence into dim_partition_dict.
      """
      new_dim_partition_dict = {}
      for index, dim_spec in enumerate(self.sharding_sequence):
          if not dim_spec.is_replica:
              if index not in new_dim_partition_dict:
                  new_dim_partition_dict[index] = []
              new_dim_partition_dict[index].extend(dim_spec.shard_list)
      self.dim_partition_dict = new_dim_partition_dict
  
imports: import operator
  from copy import deepcopy
  from functools import reduce
  import torch
  from colossalai.device.device_mesh import DeviceMesh
  from .utils import merge_same_dim_mesh_list
label_desc: Use image node_id 5 for calling the ShardingSpec obj's underlying member method code with example usage: obj.convert_shard_sequence_to_dict() without return types