class_docstr: Infer dataset for graph embedding learning.
      
code: def pass_generator(self):
      # pass generator, open a thread for processing the data
      dataset_list = []
      t = threading.Thread(
          target=self.preload_thread, args=(dataset_list,)
      )
      t.setDaemon(True)
      t.start()
  
      pass_id = 0
      while 1:
          self.ins_ready_sem.acquire()
  
          if len(dataset_list) == 0:
              log.info(
                  "infer pass[%d] dataset_list is empty" % (pass_id)
              )
              break
  
          dataset = dataset_list.pop(0)
          if dataset is None:
              log.info("infer pass[%d] dataset is null" % (pass_id))
              self.could_load_sem.release()
              continue
  
          data_size = dataset.get_memory_data_size()
          if data_size == 0:
              log.info("infer pass[%d] dataset size is 0" % (pass_id))
              self.could_load_sem.release()
              continue
  
          beginpass_begin = time.time()
          self.embedding.begin_pass()
          beginpass_end = time.time()
          log.info(
              "infer pass[%d] STAGE [BEGIN PASS] finished, time cost: %f sec",
              pass_id,
              beginpass_end - beginpass_begin,
          )
  
          yield dataset
  
          dataset.release_memory()
          endpass_begin = time.time()
          self.embedding.end_pass()
          endpass_end = time.time()
          log.info(
              "infer pass[%d] STAGE [END PASS] finished, time cost: %f sec",
              pass_id,
              endpass_end - endpass_begin,
          )
          pass_id = pass_id + 1
          self.could_load_sem.release()
      t.join()
  
imports: import os
  import time
  import threading
  import traceback
  import numpy
  import paddle
  from paddle.distributed import fleet
  import paddle.fluid
  from pgl.utils.logger import log
  import util
  import helper
  from place import get_cuda_places
  import models.model_util
label_desc: Use image node_id 2 for calling the InferDataset obj's underlying member method code with example usage: obj.pass_generator() without return types