class_docstr: Linear layer with column parallelism.
  
  The linear layer is defined as Y = XA + b. A is parallelized along
  its second dimension as A = [A_1, ..., A_p].
  
  Arguments:
      in_features: first dimension of matrix A.
      out_features: second dimension of matrix A.
      bias: If true, add bias
      gather_output: If true, call all-gather on output and make Y avaiable
                     to all GPUs, otherwise, every GPU will have its output
                     which is Y_i = XA_i
      init_method: method to initialize weights. Note that bias is always set
                   to zero.
      stride: For the strided linear layers.
      keep_master_weight_for_test: This was added for testing and should be
                                   set to False. It returns the master weights
                                   used for initialization.
class_docstr_tok: ["Linear","layer","with","column","parallelism",".","The","linear","layer","is","defined","as","Y","=","XA","+","b",".","A","is","parallelized","along","its","second","dimension","as","A","=","[","A_1",",","...",",","A_p","]",".","Arguments",":","in_features",":","first","dimension","of","matrix","A.","out_features",":","second","dimension","of","matrix","A.","bias",":","If","true",",","add","bias","gather_output",":","If","true",",","call","all-gather","on","output","and","make","Y","avaiable","to","all","GPUs",",","otherwise",",","every","GPU","will","have","its","output","which","is","Y_i","=","XA_i","init_method",":","method","to","initialize","weights",".","Note","that","bias","is","always","set","to","zero",".","stride",":","For","the","strided","linear","layers",".","keep_master_weight_for_test",":","This","was","added","for","testing","and","should","be","set","to","False",".","It","returns","the","master","weights","used","for","initialization","."]
code: def __init__(
      self,
      in_features: int,
      out_features: int,
      bias: bool = True,
      gather_output: bool = True,
      init_method: Callable[
          [torch.Tensor], torch.Tensor
      ] = init.xavier_normal_,
      stride: int = 1,
      keep_master_weight_for_test: bool = False,
  ) -> None:
      super(ColumnParallelLinear, self).__init__()
  
      # Keep input parameters
      self.in_features = in_features
      self.out_features = out_features
      self.gather_output = gather_output
      # Divide the weight matrix along the last dimension.
      world_size = get_model_parallel_world_size()
      self.output_size_per_partition = divide_and_check_no_remainder(
          out_features, world_size
      )
  
      # Parameters.
      # Note: torch.nn.functional.linear performs XA^T + b and as a result
      # we allocate the transpose.
      self.weight = Parameter(
          torch.Tensor(self.output_size_per_partition, self.in_features)
      )
      if bias:
          self.bias = Parameter(
              torch.Tensor(self.output_size_per_partition)
          )
          # Always initialize bias to zero.
          with torch.no_grad():
              self.bias.zero_()
      else:
          self.register_parameter("bias", None)
  
      # Initialize weight.
      self.master_weight = _initialize_affine_weight(
          self.weight,
          self.out_features,
          self.in_features,
          self.output_size_per_partition,
          0,
          init_method,
          stride=stride,
          return_master_weight=keep_master_weight_for_test,
      )
  
imports: from typing import Callable, Optional
  import torch
  import torch.nn.functional
  import torch.nn.init
  from torch.nn.parameter import Parameter
  from .initialize import get_model_parallel_rank, get_model_parallel_world_size
  from .mappings import copy_to_model_parallel_region, gather_from_model_parallel_region, reduce_from_model_parallel_region, scatter_to_model_parallel_region
  from .utils import VocabUtility, divide_and_check_no_remainder
label_desc: Use image node_id 1 to create a new ColumnParallelLinear object from inherited base classes: torch.nn with example: obj = ColumnParallelLinear(in_features, out_features, bias, gather_output, init_method, stride, keep_master_weight_for_test)