class_docstr: Replace original Huggingface's layer into Megatron tensor sliced layer.
  
  Args:
      model (nn.Module): Huggingface pre-trained transformer model
      mp_group (Any): process group for model parallelism
      fp16: (bool): Whether use FP16 or not.
      num_gpus (int): number of GPUs
      custom_policies (Union[Policy, List[Policy]]): custom policy object (default=None)
class_docstr_tok: ["Replace","original","Huggingface","'s","layer","into","Megatron","tensor","sliced","layer",".","Args",":","model","(","nn.Module",")",":","Huggingface","pre-trained","transformer","model","mp_group","(","Any",")",":","process","group","for","model","parallelism","fp16",":","(","bool",")",":","Whether","use","FP16","or","not",".","num_gpus","(","int",")",":","number","of","GPUs","custom_policies","(","Union","[","Policy",",","List","[","Policy","]","]",")",":","custom","policy","object","(","default=None",")"]
docstr: Set sliced parameters into original model
  
  Args:
      policy (Policy): policy object
      weight_name (Tuple[str]): names of layer's weight
      bias_name (Tuple[str]): names of layer's bias
      weight_param (Tuple[Tensor]): parameters of sliced weight
      bias_param (Tuple[Tensor]): parameters of sliced bias
      suffix (str): name of suffix in the parameters
  
  Returns:
      Policy: policy object
docstr_tok: ["Set","sliced","parameters","into","original","model","Args",":","policy","(","Policy",")",":","policy","object","weight_name","(","Tuple","[","str","]",")",":","names","of","layer","'s","weight","bias_name","(","Tuple","[","str","]",")",":","names","of","layer","'s","bias","weight_param","(","Tuple","[","Tensor","]",")",":","parameters","of","sliced","weight","bias_param","(","Tuple","[","Tensor","]",")",":","parameters","of","sliced","bias","suffix","(","str",")",":","name","of","suffix","in","the","parameters","Returns",":","Policy",":","policy","object"]
code: def set_parameters(
      self,
      policy: Policy,
      weight_name: Dict[str, Tensor],
      bias_name: Dict[str, Tensor],
      weight_param: Dict[str, Tensor],
      bias_param: Dict[str, Tensor],
      suffix: str = "data",
  ) -> Policy:
      """
      Set sliced parameters into original model
  
      Args:
          policy (Policy): policy object
          weight_name (Tuple[str]): names of layer's weight
          bias_name (Tuple[str]): names of layer's bias
          weight_param (Tuple[Tensor]): parameters of sliced weight
          bias_param (Tuple[Tensor]): parameters of sliced bias
          suffix (str): name of suffix in the parameters
  
      Returns:
          Policy: policy object
      """
      for name, param in zip(weight_name, weight_param):
          rsetattr(policy, f"{name}.{suffix}", param)
          self.set_layer_size(policy, name, param.size())
  
      for name, param in zip(bias_name, bias_param):
          rsetattr(policy, f"{name}.{suffix}", param)
  
      return policy
  
file_path: parallelformers/parallelformers/parallel/replacing.py
imports: from contextlib import suppress
  from typing import Any, Dict, Iterable, List, Optional, Tuple, Type, Union
  import torch.nn
  from torch import Size, Tensor
  from parallelformers.parallel.slicing import TensorSlicer
  from parallelformers.policies.base import Layer, Policy
  from parallelformers.policies.base.auto import AutoPolicy
  from parallelformers.utils import rgetattr, rhasattr, rsetattr
label_desc: Use image node_id 7 for calling the TensorReplacer obj's underlying member method code with example usage: obj.set_parameters(policy, weight_name, bias_name, weight_param, bias_param, suffix) and returns: policy