code: def tensor_parallel_transformation(
      exported_program: ExportedProgram,
      rank: int,
      world_size: int,
      device_type: str,
      parallel_strategies: Dict[str, ParallelStyle],
  ) -> ExportedProgram:
      """
      The entry point function to perform graph transformations on an exported program
      to transform a single-device graph into a tensor parallel graph.
  
      .. warning::
          This API is experimental and subject to change.
      """
      # TODO Migrate this to plain function call.
      return exported_program._transform_do_not_use(
          TensorParallelTransformPass(
              rank,
              world_size,
              device_type,
              exported_program.state_dict,
              exported_program.graph_signature,
              parallel_strategies,
          )
      )
  
imports: import copy
  import operator
  from typing import Any, cast, Dict, List, Optional, Sequence, Tuple
  import torch
  from torch._subclasses.fake_tensor import FakeTensor
  from torch.distributed._tensor import DeviceMesh, distribute_tensor, DTensor
  from torch.distributed._tensor.op_schema import DTensorSpec, OpSchema, OutputSharding, OutputSpecType, PlacementStrategy
  from torch.distributed._tensor.placement_types import Placement, Replicate, Shard, TensorMeta
  from torch.distributed._tensor.redistribute import redistribute_local_tensor
  from torch.distributed.tensor.parallel.style import ColwiseParallel, ParallelStyle
  from torch.export import ExportedProgram
  from torch.export.exported_program import ExportGraphSignature
  from torch.fx import GraphModule
  from torch.fx.experimental.proxy_tensor import make_fx
  from torch.fx.node import Node
  from torch.fx.passes.infra.pass_base import PassBase, PassResult
  from torch.fx.passes.shape_prop import _extract_tensor_metadata
  from torch.utils import _pytree
label_desc: Use image node_id 1 for calling a global function with example usage: tensor_parallel_transformation(exported_program, rank, world_size, device_type, parallel_strategies) and returns: exported_program