Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Remove unused loop variables #122

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion atari/benchmark-gym.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def work():
for p in procs:
p.start()

for t in tqdm.trange(100000):
for _ in tqdm.trange(100000):
Q.get()

def bench_thread(ngame):
Expand Down
2 changes: 1 addition & 1 deletion eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def actor(batch):

evaluator.episode_start(0)

for n in eval_iters.iters():
for _ in eval_iters.iters():
GC.Run()
GC.Stop()

2 changes: 1 addition & 1 deletion eval_checkforward.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def actor(self, batch):
GC.reg_callback("actor", forward_actor.actor)
GC.Start()

for n in eval_iters.iters():
for _ in eval_iters.iters():
GC.Run()
GC.Stop()

2 changes: 1 addition & 1 deletion eval_lstm.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def actor(batch):

trainer.episode_start(0)

for n in eval_iters.iters():
for _ in eval_iters.iters():
GC.Run()

GC.Stop()
2 changes: 1 addition & 1 deletion eval_reduced_mcts.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def actor(batch):
evaluator.episode_start(0)
GC.Start()

for n in eval_iters.iters():
for _ in eval_iters.iters():
GC.Run()
GC.Stop()

2 changes: 1 addition & 1 deletion ex_elfpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def actor(self, cpu_batch, gpu_batch):
wrapper.reg_callback("train", trainer.train)
wrapper.reg_callback("actor", trainer.actor)

for i in tqdm.trange(1000):
for _ in tqdm.trange(1000):
wrapper.Run()

print("Done")
4 changes: 1 addition & 3 deletions go/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,9 @@ def train(batch):
GC.Start()

import tqdm
for k in tqdm.trange(args.num_iter):
for _ in tqdm.trange(args.num_iter):
b = datetime.now()
# print("Before wait")
GC.Run()
# print("wake up from wait")
elapsed_wait_only += (datetime.now() - b).total_seconds() * 1000

print(len(game_records_visited))
Expand Down
2 changes: 1 addition & 1 deletion rlpytorch/runner/multi_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def run(self):
if args.tqdm: iterator = tqdm.trange(args.num_minibatch, ncols=50)
else: iterator = range(args.num_minibatch)

for i in iterator:
for _ in iterator:
self.GC.Run()

if self.episode_summary is not None:
Expand Down
2 changes: 1 addition & 1 deletion rts/game_CF/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def actor(batch):
GC.Start()

import tqdm
for k in tqdm.trange(nIter):
for _ in tqdm.trange(nIter):
b = datetime.now()
GC.Run()
elapsed_wait_only += (datetime.now() - b).total_seconds() * 1000
Expand Down
2 changes: 1 addition & 1 deletion rts/game_MC/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def reduced_project(batch):
GC.Start()

import tqdm
for k in tqdm.trange(nIter):
for _ in tqdm.trange(nIter):
b = datetime.now()
GC.Run()
elapsed_wait_only += (datetime.now() - b).total_seconds() * 1000
Expand Down
2 changes: 1 addition & 1 deletion rts/game_TD/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def actor(batch):
GC.Start()

import tqdm
for k in tqdm.trange(nIter):
for _ in tqdm.trange(nIter):
b = datetime.now()
GC.Run()
elapsed_wait_only += (datetime.now() - b).total_seconds() * 1000
Expand Down
2 changes: 1 addition & 1 deletion train_lstm.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

model = env["model_loaders"][0].load_model(GC.params)
mi = ModelInterface()
mi.add_model("model", model, optim_params={ "lr" : 0.001})
mi.add_model("model", model, params={ "lr" : 0.001})
mi.add_model("actor", model, copy=True, cuda=all_args.gpu is not None, gpu_id=all_args.gpu)

trainer.setup(sampler=env["sampler"], mi=mi, rl_method=env["method"])
Expand Down