code: def quantize_q8_0(tensor: torch.Tensor) -> torch.CharTensor:
      # equivalent to ggml_quantize_q8_0 in ggml.c
      invalidInputError(
          tensor.shape[1] % GGML_QK8_0 == 0,
          "tensor.shape[1] should be divided by GGML_QK8_0(64), "
          f"but get {tensor.shape[1]}",
      )
      tensor = tensor.view(-1, GGML_QK8_0)
      scale = tensor.abs().max(dim=-1, keepdim=True).values / (
          (1 << 7) - 1
      )
      tensor = (tensor / scale).round().clamp(min=-128, max=127).char()
      # add scale into each block
      tensor = torch.cat(
          (scale.half().view(torch.int8), tensor), dim=-1
      )
      return tensor
  
imports: import argparse
  import platform
  import struct
  import sys
  from enum import Enum
  from pathlib import Path
  import torch
  from tabulate import tabulate
  from tqdm import tqdm
  from transformers import AutoModel, AutoTokenizer
  from bigdl.llm.utils.common import invalidInputError
label_desc: Use image node_id 1 for calling a global function with example usage: quantize_q8_0(tensor) and returns: tensor