class_docstr: Generate sharding strategies for the batched matrix multiplication.
  
  A batched matrix multiplication can be viewed as
  [b, i, k] x [b, k, j] -> [b, i, j]
  
  The bias term is considered to have a 2D logical shape.
  
  Note: This class will be used to generate strategies for torch.bmm
  and torch.addbmm. However, the result of torch.addbmm is not correct,
  some extra runtime apply actions are required to keep numerical correctness.
class_docstr_tok: ["Generate","sharding","strategies","for","the","batched","matrix","multiplication",".","A","batched","matrix","multiplication","can","be","viewed","as","[","b",",","i",",","k","]","x","[","b",",","k",",","j","]","-",">","[","b",",","i",",","j","]","The","bias","term","is","considered","to","have","a","2D","logical","shape",".","Note",":","This","class","will","be","used","to","generate","strategies","for","torch.bmm","and","torch.addbmm",".","However",",","the","result","of","torch.addbmm","is","not","correct",",","some","extra","runtime","apply","actions","are","required","to","keep","numerical","correctness","."]
code: def collate_strategies(self) -> List[ShardingStrategy]:
      strategy_list = []
      device_mesh_is_1d = True
      if (
          len(self.device_mesh.shape) == 2
          and 1 not in self.device_mesh.shape
      ):
          device_mesh_is_1d = False
  
      if device_mesh_is_1d:
          # split only the batch dimension
          # Sb = Sb x Sb
          # can be None as it is only for 1D device mesh
          # only for 1D device mesh
          if len(self.device_mesh.shape) == 1:
              mesh_dim = 0
          else:
              mesh_dim = self.device_mesh.shape.index(1)
          strategy_list.append(self.split_one_batch_dim(mesh_dim))
      else:
          # for 2D device mesh
          # split batch dim of two inputs and the i dim of the first tensor
          # SbSi = SbSi x Sb
          strategy_list.append(self.split_batch_dim_lhs_space(0, 1))
          strategy_list.append(self.split_batch_dim_lhs_space(1, 0))
  
          # split batch dim of two inputs and the j of the second tensor
          # SbSj = Sb x SbSj
          strategy_list.append(self.split_batch_dim_rhs_space(0, 1))
          strategy_list.append(self.split_batch_dim_rhs_space(1, 0))
  
          # split batch dim of two inputs and the k dim of two inputs
          # Sb = SbSk x SbSk, need to all-reduce by k dim
          strategy_list.append(self.split_batch_dim_both_contract(0, 1))
          strategy_list.append(self.split_batch_dim_both_contract(1, 0))
  
          # split two batch dim
          strategy_list.append(self.split_two_batch_dim(0, 1))
  
      return strategy_list
  
imports: import operator
  from functools import reduce
  from typing import List
  from colossalai.auto_parallel.tensor_shard.options import SolverPerference
  from colossalai.auto_parallel.tensor_shard.sharding_strategy import CommType, MemoryCost, ShardingStrategy, TrainCycleItem
  from colossalai.auto_parallel.tensor_shard.utils import ignore_sharding_exception
  from colossalai.tensor.shape_consistency import CollectiveCommPattern
  from .strategy_generator import StrategyGenerator
label_desc: Use image node_id 10 for calling the BatchedMatMulStrategyGenerator obj's underlying member method code with example usage: obj.collate_strategies() and returns: strategy_list