code: def train(exe, program, reader, loss, log_per_step=1):
      total_loss = 0.0
      batch = 0
      reader.start()
      try:
          while True:
              num_samples = 1
              begin_time = time.time()
              (loss_val,) = exe.run(program, fetch_list=[loss.name])
              step_time = time.time() - begin_time
              loss_val = loss_val.mean()
  
              total_loss += loss_val * num_samples
              batch += 1
  
              if batch % log_per_step == 0:
                  log.info(
                      "Batch %s\t%s-Loss %.6f\t%.6f sec/step"
                      % (batch, "train", loss_val, step_time)
                  )
      except paddle.framework.core.EOFException:
          reader.reset()
  
      return total_loss / batch
  
file_path: PGL/examples/deepwalk/train_distributed_cpu.py
imports: import argparse
  import time
  import os
  import math
  import numpy
  import paddle
  import paddle.distributed.fleet
  import pgl
  from pgl.utils.logger import log
  import yaml
  from easydict import EasyDict
  from pgl.utils.data import Dataloader
  from model import SkipGramModel
  from dataset import ShardedDataset
  from dataset import BatchRandWalk
label_desc: Use image node_id 3 for calling a global function with example usage: train(exe, program, reader, loss, log_per_step) and returns: unknown