code: def sample_generator(loader):
      def __reader__():
          for indx, data in enumerate(loader):
              images = np.array(data["img"])
              yield images
  
      return __reader__
  
file_path: PaddleSeg/deploy/slim/quant/ptq.py
imports: import argparse
  import os
  import numpy
  import shutil
  import paddle
  from paddleslim.quant import quant_post_static
  from paddleseg.cvlibs import Config, SegBuilder
label_desc: Use image node_id 2 for calling a global function with example usage: sample_generator(loader) and returns: __reader__