code: def quantize_kv_cache(
      linear: torch.nn.Module, x: torch.Tensor
  ) -> bool:
      if os.environ.get("BIGDL_QUANTIZE_KV_CACHE", None) is not None:
          return os.environ["BIGDL_QUANTIZE_KV_CACHE"] == "1"
      else:
          return (
              x.device.type == "xpu"
              and get_xpu_device_type(x) == "mtl"
              and hasattr(linear, "qtype")
              and linear.qtype != ggml_tensor_qtype["fp16"]
              and linear.qtype != ggml_tensor_qtype["bf16"]
          )
  
imports: import os
  import torch
  from bigdl.llm.utils.common import invalidInputError
  from bigdl.llm.ggml.quantize import ggml_tensor_qtype
  from bigdl.llm.transformers.utils import get_ipex_version, get_xpu_device_type
label_desc: Use image node_id 4 for calling a global function with example usage: quantize_kv_cache(linear, x) and returns: unknown, unknown