code: def to_multidevice(batch_iter, num_trainer):
      """to_multidevice"""
      batch_dict = []
      for batch in batch_iter():
          batch_dict.append(batch)
          if len(batch_dict) == num_trainer:
              yield batch_dict
              batch_dict = []
  
      if len(batch_dict) > 0:
          log.warning(
              "The batch (%s) can't fill all device (%s)"
              "which will be discarded."
              % (len(batch_dict), num_trainer)
          )
  
file_path: PGL/legacy/examples/graphsage/train_multi.py
imports: import os
  import argparse
  import time
  import sys
  import traceback
  import numpy
  import scipy.sparse
  from sklearn.preprocessing import StandardScaler
  import pgl
  from pgl.utils.logger import log
  from pgl.utils import paddle_helper
  import paddle
  import paddle.fluid
  import reader
  from model import graphsage_mean, graphsage_meanpool, graphsage_maxpool, graphsage_lstm
label_desc: Use image node_id 3 for calling a global function with example usage: to_multidevice(batch_iter, num_trainer) without return types