class_docstr: BaseDataset for PGLBox.
      
docstr: compute the chunks by gpu allocated rate
docstr_tok: ["compute","the","chunks","by","gpu","allocated","rate"]
code: def compute_chunks_and_cap(self, config):
      """compute the chunks by gpu allocated rate"""
      sage_mode = config.sage_mode if config.sage_mode else False
  
      gpups_memory_allocated_rate = (
          config.gpups_memory_allocated_rate
          if config.gpups_memory_allocated_rate
          else 0.25
      )
      train_pass_cap = infer_pass_cap = compute_max_nodes(
          config.emb_size, gpups_memory_allocated_rate
      )
  
      train_chunk_nodes = int(
          config.walk_len * config.walk_times * config.batch_size
      )
      infer_chunk_nodes = int(config.infer_batch_size)
      uniq_factor = 0.4
  
      if sage_mode:
          etype2files = helper.parse_files(config.etype2files)
          etype_list = util.get_all_edge_type(
              etype2files, config.symmetry
          )
          etype_len = len(etype_list)
  
          train_chunk_nodes *= np.prod(config.samples) * config.win_size
          infer_chunk_nodes *= np.prod(config.infer_samples)
  
      if config.train_pass_cap:
          train_pass_cap = config.train_pass_cap
      if config.infer_pass_cap:
          infer_pass_cap = config.infer_pass_cap
  
      train_sample_times_one_chunk = int(
          train_pass_cap / train_chunk_nodes / uniq_factor
      )
      infer_sample_times_one_chunk = int(
          infer_pass_cap / infer_chunk_nodes
      )
  
      train_sample_times_one_chunk = max(
          train_sample_times_one_chunk, 1
      )
      infer_sample_times_one_chunk = max(
          infer_sample_times_one_chunk, 1
      )
  
      log.info(
          "sample_times_one_chunk: train [%s], infer [%s]"
          % (train_sample_times_one_chunk, infer_sample_times_one_chunk)
      )
      ret = {
          "train_pass_cap": train_pass_cap,
          "infer_pass_cap": infer_pass_cap,
          "train_sample_times_one_chunk": train_sample_times_one_chunk,
          "infer_sample_times_one_chunk": infer_sample_times_one_chunk,
      }
      return ret
  
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 BaseDataset obj's underlying member method code with example usage: obj.compute_chunks_and_cap(config) and returns: ret