code: def compute_scale_zp(target_space: QuantizationTargetSpace):
      if (
          target_space.tracked_max is None
          or target_space.tracked_min is None
      ):
          return
      tracked_min = torch.min(
          target_space.tracked_min,
          torch.zeros_like(target_space.tracked_min),
      )
      tracked_max = torch.max(
          target_space.tracked_max,
          torch.zeros_like(target_space.tracked_max),
      )
      zero_point = torch.zeros_like(tracked_min)
      if target_space.quant_scheme in ["symmetric", None]:
          abs_max = torch.max(
              torch.abs(tracked_min), torch.abs(tracked_max)
          )
          scale = abs_max / (
              float(target_space.qmax - target_space.qmin) / 2
          )
          scale = torch.max(
              scale,
              torch.full_like(scale, torch.finfo(torch.float32).eps),
          )
          # NOTE: here need to check, +1 because in pytorch, symmetric qint8 zp is 0, quint8 zp is 128.
          zero_point_val = (
              target_space.qmax + target_space.qmin + 1
          ) // 2
          zero_point = torch.full_like(zero_point, zero_point_val)
      elif target_space.quant_scheme == "affine":
          scale = (tracked_max - tracked_min) / float(
              target_space.qmax - target_space.qmin
          )
          scale = torch.max(
              scale,
              torch.full_like(scale, torch.finfo(torch.float32).eps),
          )
          zero_point = target_space.qmin - torch.round(
              tracked_min / scale
          )
      else:
          raise RuntimeError(
              f"Unknown quant_scheme {target_space.quant_scheme}"
          )
      zero_point = torch.clamp(
          zero_point, target_space.qmin, target_space.qmax
      )
      return scale, zero_point
  
imports: from __future__ import annotations
  from typing import List, Dict, Union, overload
  import torch
  from torch import Tensor
  from ..base.compressor import Compressor, Quantizer
  from ..base.wrapper import ModuleWrapper
  from ..base.target_space import QuantizationTargetSpace
  from ..utils import Evaluator, _EVALUATOR_DOCSTRING
label_desc: Use image node_id 1 for calling a global function with example usage: compute_scale_zp(target_space) and returns: scale,  zero_point