aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/kernel_tests/attention_ops_test.py
diff options
context:
space:
mode:
authorGravatar Vijay Vasudevan <vrv@google.com>2015-11-11 18:45:21 -0800
committerGravatar Vijay Vasudevan <vrv@google.com>2015-11-11 18:45:21 -0800
commitf2102f4e2c1c87f1d1bf9ab856a2849c54478760 (patch)
tree54ffdbb4081d6e75d4e626682ea9c70e6866599b /tensorflow/python/kernel_tests/attention_ops_test.py
parent3961abed9560cd852fff4add393b451483bbc3af (diff)
TensorFlow: upstream changes from the afternoon.
Changes: - futurize --stage2 changes for Python 3 compatibility by @girving. - Small updates to documentation by @vrv, schuster and others - Account for failure of std::thread::hardware_concurrency by @ebrevdo. - More changes for backwards-compatibility tests by Josh - Updates to python op doc generation by Josh - Added support for using the best-fit allocator via ConfigProto by @vrv. - Rename LocalSession to DirectSession, since local was a bad name for it. - Enable tf.nn.moments() to work with tensors of unknown shape by @mrry. GITHUB_ISSUE: 139 - Changes for Android build by Andrew. Base CL: 107645181
Diffstat (limited to 'tensorflow/python/kernel_tests/attention_ops_test.py')
-rw-r--r--tensorflow/python/kernel_tests/attention_ops_test.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/tensorflow/python/kernel_tests/attention_ops_test.py b/tensorflow/python/kernel_tests/attention_ops_test.py
index 5541c541b2..500d85e6d0 100644
--- a/tensorflow/python/kernel_tests/attention_ops_test.py
+++ b/tensorflow/python/kernel_tests/attention_ops_test.py
@@ -1,5 +1,9 @@
"""Tests for tensorflow.ops.attention_ops."""
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function
+
import tensorflow.python.platform
import tensorflow as tf
@@ -80,8 +84,8 @@ class ExtractGlimpseTest(tf.test.TestCase):
# Check entries.
min_random_val = 0
max_random_val = max(rows, cols)
- for i in range(0, glimpse_sizes[0]):
- for j in range(0, glimpse_sizes[1]):
+ for i in range(glimpse_sizes[0]):
+ for j in range(glimpse_sizes[1]):
if expected_rows[i] is None or expected_cols[j] is None:
self.assertGreaterEqual(value_rows[0][i][j][0], min_random_val)
self.assertLessEqual(value_rows[0][i][j][0], max_random_val)
@@ -102,15 +106,15 @@ class ExtractGlimpseTest(tf.test.TestCase):
self._VerifyValues(tensor_in_sizes=[41, 61],
glimpse_sizes=[41, 61],
offsets=[0.0, 0.0],
- expected_rows=range(1, 42),
- expected_cols=range(1, 62))
+ expected_rows=list(range(1, 42)),
+ expected_cols=list(range(1, 62)))
def testTooLargeCenterGlimpse(self):
self._VerifyValues(tensor_in_sizes=[41, 61],
glimpse_sizes=[43, 63],
offsets=[0.0, 0.0],
- expected_rows=[None] + range(1, 42) + [None],
- expected_cols=[None] + range(1, 62) + [None])
+ expected_rows=[None] + list(range(1, 42)) + [None],
+ expected_cols=[None] + list(range(1, 62)) + [None])
def testGlimpseFullOverlap(self):
self._VerifyValues(tensor_in_sizes=[41, 61],