code: def train_input_generator(x_train, y_train, batch_size=64):
      assert len(x_train) == len(y_train)
      while True:
          p = np.random.permutation(len(x_train))
          x_train, y_train = x_train[p], y_train[p]
          index = 0
          while index <= len(x_train) - batch_size:
              yield x_train[index : index + batch_size], y_train[
                  index : index + batch_size
              ],
              index += batch_size
  
file_path: byteps/example/tensorflow/tensorflow_mnist.py
imports: import os
  import errno
  import byteps.tensorflow
  import numpy
  from tensorflow import keras
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: train_input_generator(x_train, y_train, batch_size) without return types