class_docstr: Layout of a tensor.
  
  Attributes:
      device_mesh: the device mesh to store the tensor distributed.
      sharding_spec: the sharding specification to describe how the tensor is sharded.
      global_shape: the entire shape of the global tensor.
class_docstr_tok: ["Layout","of","a","tensor",".","Attributes",":","device_mesh",":","the","device","mesh","to","store","the","tensor","distributed",".","sharding_spec",":","the","sharding","specification","to","describe","how","the","tensor","is","sharded",".","global_shape",":","the","entire","shape","of","the","global","tensor","."]
code: def __hash__(self) -> int:
      return hash(f"{self.sharding_spec}")
  
file_path: ColossalAI/colossalai/tensor/d_tensor/layout.py
imports: import operator
  from functools import reduce
  import torch
  from colossalai.device.device_mesh import DeviceMesh
  from .misc import DuplicatedShardingDimensionError, ShardingNotDivisibleError
  from .sharding_spec import ShardingSpec
label_desc: Use image node_id 2 for calling the Layout obj's underlying member method code with example usage: obj.__hash__() and returns: hash