class_docstr: OutputGenerator is a generic class to generate strategies for Output Node.
docstr: Generate distributed strategy for output node.
docstr_tok: ["Generate","distributed","strategy","for","output","node","."]
code: def distributed_strategy(
      self, mesh_list: List[List[int]] = None
  ) -> List[ShardingStrategy]:
      """
      Generate distributed strategy for output node.
      """
      # TODO: need to take care of the case when the first element of output only need to be sharded.
      output_op_data = self.op_data["output"]
      if isinstance(output_op_data.data, tuple):
          length = len(output_op_data.data)
          dim_partition_dict_mapping = {
              "output": [{0: mesh_list}] * length,
          }
      else:
          dim_partition_dict_mapping = {
              "output": {0: mesh_list},
          }
      for index, _ in enumerate(self.predecessor_nodes):
          mapping_name = f"input_{index}"
          dim_partition_dict_mapping[mapping_name] = {0: mesh_list}
  
      communication_action_mapping = {}
      sharding_spec_mapping = self.to_sharding_spec_mapping(
          dim_partition_dict_mapping
      )
  
      name = "Distributed Output"
  
      strategy = self.get_sharding_strategy(
          name=name,
          sharding_spec_mapping=sharding_spec_mapping,
          communication_action_mapping=communication_action_mapping,
      )
      return strategy
  
file_path: ColossalAI/colossalai/auto_parallel/tensor_shard/node_handler/strategy/output_generator.py
imports: from typing import Dict, List
  from torch.fx import Node
  from colossalai.auto_parallel.tensor_shard.sharding_strategy import MemoryCost, OperationData, ShardingStrategy, TrainCycleItem
  from colossalai.device.device_mesh import DeviceMesh
  from .strategy_generator import OutputStrategyGenerator
label_desc: Use image node_id 6 for calling the OutputGenerator obj's underlying member method code with example usage: obj.distributed_strategy(mesh_list) and returns: strategy