code: def generate_sharding_size(dim_partition_dict, device_mesh):
      total_sharding_size = 1
      for mesh_dim_list in dim_partition_dict.values():
          mesh_dim_sharding_size = [
              device_mesh.shape[mesh_dim] for mesh_dim in mesh_dim_list
          ]
          sharding_size = reduce(operator.mul, mesh_dim_sharding_size)
          total_sharding_size *= sharding_size
  
      return total_sharding_size
  
file_path: colossalai/colossalai/auto_parallel/tensor_shard/utils/sharding.py
imports: import operator
  from copy import deepcopy
  from functools import reduce
  from typing import Dict
  import torch
  from colossalai.tensor.sharding_spec import ShardingSpec
label_desc: Use image node_id 5 for calling a global function with example usage: generate_sharding_size(dim_partition_dict, device_mesh) and returns: total_sharding_size