code: def quantize_per_channel(
      input: torch.Tensor,
      scales: torch.Tensor,
      zero_points: torch.Tensor,
      axis: int,
      quant_min: int,
      quant_max: int,
      dtype: torch.dtype,
  ) -> torch.Tensor:
      """Affine per channel quantization for the Tensor using the same quantization
      parameters for each channel/axis to map from floating point to quantized values
  
      Args:
         input (torch.Tensor): original float32 or bfloat16 Tensor
         scales (torch.Tensor): a list of scale quantization parameter for
         affine quantization, one per channel
         zero_point (torch.Tensor): a list of zero_point quantization parameter for
         affine quantization, one per channel
         quant_min (int): minimum quantized value for output Tensor
         quant_max (int): maximum quantized value for output Tensor
         dtype (torch.dtype): requested dtype (e.g. torch.uint8) for output Tensor
  
      Returns:
         Tensor with requested dtype (e.g. torch.uint8), note the quantization parameters
         are not stored in the Tensor, we are storing them in function arguments instead
      """
      if input.dtype == torch.bfloat16:
          input = input.to(torch.float32)
  
      assert (
          input.dtype == torch.float32
      ), f"Expecting input to have dtype torch.float32, but got dtype: {input.dtype}"
      assert axis < input.dim(), f"Expecting axis to be < {input.dim()}"
      _quant_min_max_bounds_check(quant_min, quant_max, dtype)
      input, permute_axis_list = _permute_to_axis_zero(input, axis)
      res = torch.zeros_like(input)
  
      for i in range(input.size(0)):
          res[i] = torch.clamp(
              torch.round(input[i] * (1.0 / scales[i]))
              + zero_points[i],
              quant_min,
              quant_max,
          )
  
      out = res.permute(tuple(permute_axis_list))
      return out.to(dtype)
  
imports: import torch
  from torch.library import Library, impl
  from torch.ao.quantization.utils import determine_qparams, validate_qmin_qmax
  from typing import Tuple
label_desc: Use image node_id 17 for calling a global function with example usage: quantize_per_channel(input, scales, zero_points, axis, quant_min, quant_max, dtype) and returns: out