code: def run_train_step(agent, rpm):
      for step in range(args.train_total_steps):
          # use the first 80% data to train
          (
              batch_all_obs,
              batch_action,
              batch_reward,
              batch_isOver,
          ) = rpm.sample_batch(args.batch_size * gpu_num)
          batch_obs = batch_all_obs[:, :CONTEXT_LEN, :, :]
          batch_next_obs = batch_all_obs[:, 1:, :, :]
          cost = agent.learn(
              batch_obs,
              batch_action,
              batch_reward,
              batch_next_obs,
              batch_isOver,
          )
  
          if step % 100 == 0:
              # use the last 20% data to evaluate
              (
                  batch_all_obs,
                  batch_action,
                  batch_reward,
                  batch_isOver,
              ) = rpm.sample_test_batch(args.batch_size)
              batch_obs = batch_all_obs[:, :CONTEXT_LEN, :, :]
              batch_next_obs = batch_all_obs[:, 1:, :, :]
              eval_cost = agent.supervised_eval(
                  batch_obs,
                  batch_action,
                  batch_reward,
                  batch_next_obs,
                  batch_isOver,
              )
              logger.info(
                  "train step {}, train costs are {}, eval cost is {}.".format(
                      step, cost, eval_cost
                  )
              )
  
file_path: PARL/benchmark/fluid/offline-Q-learning/parallel_run.py
imports: from parl.utils import check_version_for_fluid
  import argparse
  import gym
  import numpy
  import os
  import time
  from tqdm import tqdm
  import parl
  import paddle.fluid
  from parl.utils import get_gpu_count
  from parl.utils import summary, logger
  from dqn import DQN
  from atari_agent import AtariAgent
  from atari_model import AtariModel
  from replay_memory import ReplayMemory, Experience
  from utils import get_player
label_desc: Use image node_id 1 for calling a global function with example usage: run_train_step(agent, rpm) without return types