code: def _initialize_affine_weight_cpu(
      weight,
      output_size,
      input_size,
      per_partition_size,
      partition_dim,
      init_method,
      stride=1,
      return_master_weight=False,
      *,
      params_dtype=torch.float32,
  ):
      """Initialize affine weight for model parallel.
  
      Build the master weight on all processes and scatter
      the relevant chunk."""
  
      set_tensor_model_parallel_attributes(
          tensor=weight,
          is_parallel=True,
          dim=partition_dim,
          stride=stride,
      )
  
      # Initialize master weight
      master_weight = torch.empty(
          output_size,
          input_size,
          dtype=torch.float,
          requires_grad=False,
      )
      init_method(master_weight)
      master_weight = master_weight.to(dtype=params_dtype)
  
      # Split and copy
      per_partition_per_stride_size = divide(per_partition_size, stride)
      weight_list = torch.split(
          master_weight,
          per_partition_per_stride_size,
          dim=partition_dim,
      )
      rank = get_tensor_model_parallel_rank()
      world_size = get_tensor_model_parallel_world_size()
      my_weight_list = weight_list[rank::world_size]
  
      with torch.no_grad():
          torch.cat(my_weight_list, dim=partition_dim, out=weight)
      if return_master_weight:
          return master_weight
      return None
  
imports: from typing import Optional, Dict, Tuple, List
  import warnings
  import torch
  import torch.nn.functional
  import torch.nn.init
  from torch.nn.parameter import Parameter
  from apex._autocast_utils import _cast_if_autocast_enabled
  from apex.transformer.parallel_state import get_tensor_model_parallel_group
  from apex.transformer.parallel_state import get_tensor_model_parallel_rank
  from apex.transformer.parallel_state import get_tensor_model_parallel_world_size
  from apex.transformer.utils import divide
  from apex.transformer.tensor_parallel.mappings import copy_to_tensor_model_parallel_region
  from apex.transformer.tensor_parallel.mappings import gather_from_tensor_model_parallel_region
  from apex.transformer.tensor_parallel.mappings import reduce_from_tensor_model_parallel_region
  from apex.transformer.tensor_parallel.mappings import scatter_to_tensor_model_parallel_region
  from apex.transformer.tensor_parallel.mappings import reduce_scatter_to_sequence_parallel_region
  from apex.transformer.tensor_parallel.random import get_cuda_rng_tracker
  from apex.transformer.tensor_parallel.utils import VocabUtility
  from apex.transformer.log_util import get_transformer_logger
label_desc: Use image node_id 6 for calling a global function with example usage: _initialize_affine_weight_cpu(weight, output_size, input_size, per_partition_size, partition_dim, init_method, stride, return_master_weight) and returns: None, master_weight