Skip to content

Commit f1d5318

Browse files
Shuolongbjcarusyte
authored andcommitted
Redefine xrange for Python 3
* Replace xrange() with range()
1 parent e3ff5b8 commit f1d5318

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

repeat_copy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ def _readable(datum):
8686
obs_batch = data.observations
8787
targ_batch = data.target
8888

89-
iterate_over = xrange(batch_size) if whole_batch else xrange(1)
89+
iterate_over = range(batch_size) if whole_batch else range(1)
9090

9191
batch_strings = []
9292
for batch_index in iterate_over:
9393
obs = obs_batch[:, batch_index, :]
9494
targ = targ_batch[:, batch_index, :]
9595

96-
obs_channels = xrange(obs.shape[1])
97-
targ_channels = xrange(targ.shape[1])
96+
obs_channels = range(obs.shape[1])
97+
targ_channels = range(targ.shape[1])
9898
obs_channel_strings = [_readable(obs[:, i]) for i in obs_channels]
9999
targ_channel_strings = [_readable(targ[:, i]) for i in targ_channels]
100100

train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def train(num_training_iterations, report_interval):
144144
start_iteration = sess.run(global_step)
145145
total_loss = 0
146146

147-
for train_iteration in xrange(start_iteration, num_training_iterations):
147+
for train_iteration in range(start_iteration, num_training_iterations):
148148
_, loss = sess.run([train_step, train_loss])
149149
total_loss += loss
150150

0 commit comments

Comments
 (0)