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].
code: def __init__(
      self,
      device_mesh: DeviceMesh,
      entire_shape: torch.Size,
      dim_partition_dict=None,
      sharding_sequence=None,
  ):
      self.device_mesh = device_mesh
  
      if isinstance(entire_shape, (list, tuple)):
          entire_shape = torch.Size(entire_shape)
      self.entire_shape = entire_shape
      self.dim_partition_dict = dim_partition_dict
      self.sharding_sequence = sharding_sequence
      if self.sharding_sequence is None:
          assert (
              self.dim_partition_dict is not None
          ), f"dim_partition_dict should not be None, if sharding_sequence is NoneType object."
          self.dim_partition_dict = merge_same_dim_mesh_list(
              dim_size=len(entire_shape),
              dim_partition_dict=self.dim_partition_dict,
          )
          self.convert_dict_to_shard_sequence()
      elif self.dim_partition_dict is None:
          assert (
              self.sharding_sequence is not None
          ), f"sharding_sequence should not be None, if dim_partition_dict is NoneType object."
          self.convert_shard_sequence_to_dict()
      self._sanity_check()
  
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 1 to create a new ShardingSpec object  with example: obj = ShardingSpec(device_mesh, entire_shape, dim_partition_dict, sharding_sequence)