code: def fake_int8_quantize(module):
      i = 0
      for name, submodule in tqdm(module.named_modules()):
          if hasattr(submodule, "weight"):
              i += 1
              submodule.weight.data = torch.from_numpy(
                  fake_linear_quantize(submodule.weight.data.numpy())
              )
      logger.info(f"{i} modules fake int8 quantized")
      return module
  
imports: from collections import OrderedDict
  from copy import deepcopy
  from functools import partial
  import argparse
  import gc
  import json
  import logging
  import numpy
  import os
  from PIL import Image
  from python_coreml_stable_diffusion.torch2coreml import compute_psnr, get_pipeline
  import time
  import torch
  import torch.nn
  import requests
  from tqdm import tqdm, trange
  from coremltools.converters.mil.mil import types
label_desc: Use image node_id 5 for calling a global function with example usage: fake_int8_quantize(module) and returns: module