File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 2727tf .flags .DEFINE_integer ("max_global_steps" , None , "Stop after this many steps in the environment" )
2828tf .flags .DEFINE_integer ("eval_every" , 300 , "Evaluate the policy ever [eval_every] seconds" )
2929tf .flags .DEFINE_boolean ("reset" , False , "If true, delete the existing model directory" )
30+ tf .flags .DEFINE_integer ("parallelism" , None , "Number of threads to run. If not given we run [num_cpu_cores] threads." )
3031
3132FLAGS = tf .flags .FLAGS
3233
@@ -35,6 +36,10 @@ def make_env():
3536
3637VALID_ACTIONS = [0 , 1 , 2 , 3 ]
3738NUM_WORKERS = multiprocessing .cpu_count ()
39+
40+ if FLAGS .parallelism :
41+ NUM_WORKERS = FLAGS .parallelism
42+
3843MODEL_DIR = FLAGS .model_dir
3944CHECKPOINT_DIR = os .path .join (MODEL_DIR , "checkpoints" )
4045
You can’t perform that action at this time.
0 commit comments