code: def concat_to_compat_param(
      quantized_weight: Tensor,
      quant_scale: Tensor,
      quant_min: Tensor,
      return_param: bool = True,
  ) -> Union[nn.Parameter, Tensor]:
      shape_wieght = quantized_weight.shape
      shape_scale = quant_scale.shape
      shape_min = quant_min.shape
  
      quantized_weight = torch.flatten(quantized_weight)
      quant_scale = torch.flatten(quant_scale)
      quant_min = torch.flatten(quant_min)
  
      def deconcat_individual_tensors(
          shape_wieght: torch.Size,
          shape_scale: torch.Size,
          shape_min: torch.Size,
      ) -> Callable:
          def fn(
              compat_tensor: nn.Parameter,
          ) -> Tuple[Tensor, Tensor, Tensor]:
              weight = torch.narrow(
                  compat_tensor, 0, 0, shape_wieght.numel()
              ).view(shape_wieght)
              scale = torch.narrow(
                  compat_tensor,
                  0,
                  shape_wieght.numel(),
                  shape_scale.numel(),
              ).view(shape_scale)
              min_val = torch.narrow(
                  compat_tensor,
                  0,
                  shape_wieght.numel() + shape_scale.numel(),
                  shape_min.numel(),
              ).view(shape_min)
  
              return weight, scale, min_val
  
          return fn
  
      compat_tensor = torch.concat(
          [quantized_weight, quant_scale, quant_min]
      )
      if return_param:
          compat_tensor = nn.Parameter(
              compat_tensor, requires_grad=False
          )
      compat_tensor.deconcat = deconcat_individual_tensors(
          shape_wieght, shape_scale, shape_min
      )
  
      return compat_tensor
  
imports: import torch
  import deepspeed
  from torch import Tensor
  from typing import Tuple
  import torch.nn
  from typing import Dict, Callable, Union
  from deepspeed.accelerator import get_accelerator
  import functools
label_desc: Use image node_id 6 for calling a global function with example usage: concat_to_compat_param(quantized_weight, quant_scale, quant_min, return_param) and returns: compat_tensor, fn, weight,  scale,  min_val