code: def _apply_tp_Transformer(Transformer: Transformer) -> None:
      # overwrite config before Transformer.setup_cache is called
      world_size = _get_world_size()
      Transformer.config.n_head = (
          Transformer.config.n_head // world_size
      )
      Transformer.config.dim = Transformer.config.dim // world_size
      Transformer.config.n_local_heads = (
          Transformer.config.n_local_heads // world_size
      )
  
file_path: gpt-fast/tp.py
imports: import os
  from typing import List, Optional
  import torch
  import torch.distributed
  from torch import nn
  from torch.distributed import _functional_collectives
  from model import Attention, FeedForward, Transformer
  from quantize import WeightOnlyInt4Linear
label_desc: Use image node_id 9 for calling a global function with example usage: _apply_tp_Transformer(Transformer) without return types