Skip to content

Commit e3826c7

Browse files
author
Elvis Dowson
committed
scripts/training.py: Python 3: Refactor to use range() instead of xrange().
Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com>
1 parent 8a55b99 commit e3826c7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/training.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def getResnetModel(d):
196196
# Stage 2
197197
#
198198

199-
for i in xrange(n):
199+
for i in range(n):
200200
O = getResidualBlock(O, filsize, [sf, sf], 2, str(i), 'regular', convArgs, bnArgs, d)
201201
if i == n//2 and d.spectral_pool_scheme == "stagemiddle":
202202
O = applySpectralPooling(O, d)
@@ -209,7 +209,7 @@ def getResnetModel(d):
209209
if d.spectral_pool_scheme == "nodownsample":
210210
O = applySpectralPooling(O, d)
211211

212-
for i in xrange(n-1):
212+
for i in range(n-1):
213213
O = getResidualBlock(O, filsize, [sf*2, sf*2], 3, str(i+1), 'regular', convArgs, bnArgs, d)
214214
if i == n//2 and d.spectral_pool_scheme == "stagemiddle":
215215
O = applySpectralPooling(O, d)
@@ -222,7 +222,7 @@ def getResnetModel(d):
222222
if d.spectral_pool_scheme == "nodownsample":
223223
O = applySpectralPooling(O, d)
224224

225-
for i in xrange(n-1):
225+
for i in range(n-1):
226226
O = getResidualBlock(O, filsize, [sf*4, sf*4], 4, str(i+1), 'regular', convArgs, bnArgs, d)
227227
if i == n//2 and d.spectral_pool_scheme == "stagemiddle":
228228
O = applySpectralPooling(O, d)

0 commit comments

Comments
 (0)