Skip to content

Commit 848cc59

Browse files
author
cclauss
committed
from six.moves import xrange (en masse)
1 parent 3cb798f commit 848cc59

File tree

74 files changed

+82
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+82
-22
lines changed

research/brain_coder/common/config_lib.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import ast
1212
import itertools
13+
from six.moves import xrange
1314

1415

1516
class Config(dict):

research/brain_coder/common/schedules_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from math import exp
88
from math import sqrt
99
import numpy as np
10+
from six.moves import xrange
1011
import tensorflow as tf
1112

1213
from common import config_lib # brain coder

research/brain_coder/common/utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from absl import logging
1414
import numpy as np
15+
from six.moves import xrange
1516
import tensorflow as tf
1617

1718

research/brain_coder/single_task/code_tasks.py

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from absl import logging
1313
import numpy as np
14+
from six.moves import xrange
1415

1516
from common import bf # brain coder
1617
from common import reward as r # brain coder

research/brain_coder/single_task/ga_lib.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from absl import flags
1515
from absl import logging
1616
import numpy as np
17+
from six.moves import xrange
1718

1819
from common import bf # brain coder
1920
from common import utils # brain coder
@@ -469,4 +470,3 @@ def __init__(self, *args):
469470

470471
def random_individual(genome_size):
471472
return lambda: Individual(np.random.choice(GENES, genome_size).tolist())
472-

research/brain_coder/single_task/ga_train.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from absl import flags
1919
from absl import logging
2020
import numpy as np
21+
from six.moves import xrange
2122
import tensorflow as tf
2223

2324
from common import utils # brain coder
@@ -321,4 +322,3 @@ def run_random_search(max_num_programs, checkpoint_dir, task_eval_fn,
321322
solution_found=found_solution, generations=num_programs_seen,
322323
num_programs=num_programs_seen, max_generations=max_num_programs,
323324
max_num_programs=max_num_programs)
324-

research/brain_coder/single_task/pg_agent.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
from absl import logging
1717
import numpy as np
18+
from six.moves import xrange
1819
import tensorflow as tf
1920

2021
from common import rollout as rollout_lib # brain coder
@@ -1294,4 +1295,3 @@ def process_episodes(
12941295
batch_targets = np.array([], dtype=np.float32)
12951296

12961297
return (batch_targets, batch_returns)
1297-

research/brain_coder/single_task/pg_agent_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from absl import logging
1010
import numpy as np
11+
from six.moves import xrange
1112
import tensorflow as tf
1213

1314
from common import utils # brain coder

research/brain_coder/single_task/results_lib.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from collections import namedtuple
99
import os
1010
import re
11+
from six.moves import xrange
1112
import tensorflow as tf
1213

1314

@@ -152,4 +153,3 @@ def read_all(self, num_shards=None):
152153
r for shard_results in results_per_shard for r in shard_results]
153154

154155
return aggregate, shard_stats
155-

research/brain_coder/single_task/results_lib_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import os
99
import shutil
1010
import tempfile
11+
from six.moves import xrange
1112
import tensorflow as tf
1213

1314
from single_task import results_lib # brain coder

research/brain_coder/single_task/test_tasks.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
"""Tasks that test correctness of algorithms."""
66

7+
from six.moves import xrange
78
from common import reward as reward_lib # brain coder
89
from single_task import misc # brain coder
910

@@ -124,5 +125,3 @@ def __call__(self, actions):
124125
# closest next element.
125126
# Maximum distance possible is num_actions * base / 2 = 3 * 8 / 2 = 12
126127
return (len(prefix) + (1 - min_dist / 12.0)), False
127-
128-

research/brain_coder/single_task/tune.py

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
from absl import flags
4040
from absl import logging
4141
import numpy as np
42+
from six.moves import xrange
4243
import tensorflow as tf
4344

4445
from single_task import defaults # brain coder

research/compression/entropy_coder/dataset/gen_synthetic_dataset.py

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import os
1919

2020
import numpy as np
21+
from six.moves import xrange
2122
import tensorflow as tf
2223

2324
import synthetic_model

research/compression/entropy_coder/dataset/synthetic_model.py

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"""Binary code sample generator."""
1717

1818
import numpy as np
19+
from six.moves import xrange
1920

2021

2122
_CRC_LINE = [

research/compression/entropy_coder/lib/blocks_masked_conv2d.py

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"""Define some typical masked 2D convolutions."""
1717

1818
import numpy as np
19+
from six.moves import xrange
1920
import tensorflow as tf
2021

2122
import block_util

research/compression/entropy_coder/lib/blocks_masked_conv2d_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from __future__ import unicode_literals
2020

2121
import numpy as np
22+
from six.moves import xrange
2223
import tensorflow as tf
2324

2425
import blocks_masked_conv2d

research/compression/entropy_coder/lib/blocks_std_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import os
2323

2424
import numpy as np
25+
from six.moves import xrange
2526
import tensorflow as tf
2627

2728
import blocks_std

research/delf/delf/python/feature_io.py

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from delf import feature_pb2
2626
from delf import datum_io
2727
import numpy as np
28+
from six.moves import xrange
2829
import tensorflow as tf
2930

3031

research/differential_privacy/dp_sgd/dp_mnist/dp_mnist.py

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import time
2323

2424
import numpy as np
25+
from six.moves import xrange
2526
import tensorflow as tf
2627

2728
from differential_privacy.dp_sgd.dp_optimizer import dp_optimizer

research/differential_privacy/dp_sgd/per_example_gradients/per_example_gradients.py

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import collections
1919

20+
from six.moves import xrange
2021
import tensorflow as tf
2122

2223
OrderedDict = collections.OrderedDict

research/differential_privacy/multiple_teachers/aggregation.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from __future__ import print_function
2020

2121
import numpy as np
22+
from six.moves import xrange
2223

2324

2425
def labels_from_probs(probs):
@@ -127,5 +128,3 @@ def aggregation_most_frequent(logits):
127128
result[i] = np.argmax(label_counts)
128129

129130
return np.asarray(result, dtype=np.int32)
130-
131-

research/differential_privacy/multiple_teachers/deep_cnn.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from datetime import datetime
2121
import math
2222
import numpy as np
23+
from six.moves import xrange
2324
import tensorflow as tf
2425
import time
2526

@@ -600,5 +601,3 @@ def softmax_preds(images, ckpt_path, return_logits=False):
600601
tf.reset_default_graph()
601602

602603
return preds
603-
604-

research/differential_privacy/multiple_teachers/input.py

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import os
2525
from scipy.io import loadmat as loadmat
2626
from six.moves import urllib
27+
from six.moves import xrange
2728
import sys
2829
import tarfile
2930

research/differential_privacy/multiple_teachers/train_student.py

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from __future__ import print_function
2020

2121
import numpy as np
22+
from six.moves import xrange
2223
import tensorflow as tf
2324

2425
from differential_privacy.multiple_teachers import aggregation

research/domain_adaptation/domain_separation/dsn_eval.py

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import math
2020

2121
import numpy as np
22+
from six.moves import xrange
2223
import tensorflow as tf
2324

2425
from domain_adaptation.datasets import dataset_factory

research/gan/cifar/util.py

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from __future__ import division
1919
from __future__ import print_function
2020

21+
from six.moves import xrange
2122
import tensorflow as tf
2223
tfgan = tf.contrib.gan
2324

research/gan/image_compression/networks_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from __future__ import print_function
2020

2121
import tensorflow as tf
22+
from six.moves import xrange
2223
import networks
2324

2425

research/gan/mnist/util.py

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525

2626
import numpy as np
27+
from six.moves import xrange
2728
import tensorflow as tf
2829

2930
ds = tf.contrib.distributions

research/gan/mnist_estimator/train.py

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import numpy as np
2424
import scipy.misc
25+
from six.moves import xrange
2526
import tensorflow as tf
2627

2728
from mnist import data_provider

research/im2txt/im2txt/data/build_mscoco_data.py

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797

9898
import nltk.tokenize
9999
import numpy as np
100+
from six.moves import xrange
100101
import tensorflow as tf
101102

102103
tf.flags.DEFINE_string("train_image_dir", "/tmp/train2014/",

research/learned_optimizer/metaopt.py

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import time
2222

2323
import numpy as np
24+
from six.moves import xrange
2425
import tensorflow as tf
2526

2627
from learned_optimizer.optimizer import trainable_optimizer

research/learning_to_remember_rare_events/data_utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from scipy.misc import imresize
3030
from scipy.misc import imrotate
3131
from scipy.ndimage import imread
32+
from six.moves import xrange
3233
import tensorflow as tf
3334

3435

research/learning_to_remember_rare_events/memory.py

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"""
2424

2525
import numpy as np
26+
from six.moves import xrange
2627
import tensorflow as tf
2728

2829

research/learning_to_remember_rare_events/train.py

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import random
2727

2828
import numpy as np
29+
from six.moves import xrange
2930
import tensorflow as tf
3031

3132
import data_utils

research/lfads/synth_data/generate_itb_data.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import h5py
1919
import numpy as np
2020
import os
21+
from six.moves import xrange
2122
import tensorflow as tf
2223

2324
from utils import write_datasets
@@ -47,12 +48,12 @@
4748
flags.DEFINE_float("u_std", 0.25,
4849
"Std dev of input to integration to bound model")
4950
flags.DEFINE_string("checkpoint_path", "SAMPLE_CHECKPOINT",
50-
"""Path to directory with checkpoints of model
51+
"""Path to directory with checkpoints of model
5152
trained on integration to bound task. Currently this
5253
is a placeholder which tells the code to grab the
53-
checkpoint that is provided with the code
54-
(in /trained_itb/..). If you have your own checkpoint
55-
you would like to restore, you would point it to
54+
checkpoint that is provided with the code
55+
(in /trained_itb/..). If you have your own checkpoint
56+
you would like to restore, you would point it to
5657
that path.""")
5758
FLAGS = flags.FLAGS
5859

research/lfads/synth_data/generate_labeled_rnn_data.py

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import os
1919
import h5py
2020
import numpy as np
21+
from six.moves import xrange
2122

2223
from synthetic_data_utils import generate_data, generate_rnn
2324
from synthetic_data_utils import get_train_n_valid_inds

research/neural_gpu/data_utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import time
2222

2323
import numpy as np
24+
from six.moves import xrange
2425
import tensorflow as tf
2526

2627
import program_utils

research/next_frame_prediction/cross_conv/eval.py

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import time
2121

2222
import numpy as np
23+
from six.moves import xrange
2324
import tensorflow as tf
2425

2526
import model as cross_conv_model

research/next_frame_prediction/cross_conv/example_gen.py

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import sys
1919

2020
import numpy as np
21+
from six.moves import xrange
2122
import tensorflow as tf
2223

2324

research/next_frame_prediction/cross_conv/model.py

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import math
2121
import sys
2222

23+
from six.moves import xrange
2324
import tensorflow as tf
2425

2526
slim = tf.contrib.slim

research/next_frame_prediction/cross_conv/reader.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
"""Read image sequence."""
1717

18+
from six.moves import xrange
1819
import tensorflow as tf
1920

2021

research/next_frame_prediction/cross_conv/sprites_gen.py

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import numpy as np
2323
import scipy.misc
24+
from six.moves import xrange
2425
import tensorflow as tf
2526

2627

research/object_detection/dataset_tools/oid_tfrecord_creation.py

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from __future__ import division
1919
from __future__ import print_function
2020

21+
from six.moves import xrange
2122
import tensorflow as tf
2223

2324
from object_detection.core import standard_fields

0 commit comments

Comments
 (0)