code: def _quantize_int8(
      self, tensor: Tensor
  ) -> Tuple[Tensor, Tensor, Tensor]:
      q_range = 2 ** self.config["num_bits"] - 1
      min_value = tensor.amin(
          dim=self.config["group_dim"] + 1, keepdim=True
      )
      max_value = tensor.amax(
          dim=self.config["group_dim"] + 1, keepdim=True
      )
  
      scale = q_range / (max_value - min_value)
  
      tensor = tensor.sub_(min_value).mul_(scale)
      tensor = tensor_round(tensor_clamp(tensor, 0, q_range)).to(
          torch.uint8
      )
      return tensor, scale, min_value
  
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 3 for calling the Quantizer obj's underlying member method code with example usage: obj._quantize_int8(tensor) and returns: tensor,  scale,  min_value