import tensorflow as tf

        # first task or maxstep, update the model
        if not test and (TASK_NUM == 0 or TASK_NUM % maxstep == 0):
            logger.info(f"task_num={TASK_NUM}, sync_model_to_lazymodel")
            tf.get_default_session().run(sync_model_to_lazymodel)

        if test:
