aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/kernel_tests/lookup_table_op_test.py
diff options
context:
space:
mode:
authorGravatar Vijay Vasudevan <vrv@google.com>2015-11-10 15:23:01 -0800
committerGravatar Vijay Vasudevan <vrv@google.com>2015-11-10 15:23:01 -0800
commitc61c39614a4780464037226d9d3c28101f7e8e46 (patch)
treee615bdecafe406289b0a6ed77b40e6d5865c9816 /tensorflow/python/kernel_tests/lookup_table_op_test.py
parent9274f5aa478879386870bb0cb889e432d4aee330 (diff)
TensorFlow: upstream changes to git (doc fixes).
Changes: - Fix typos across several files contributed by Erik Erwitt, and Michael R. Berstein - Fix bug in translate example (fr->en typo) by schuster - Updates to some documentation (mcoram,shlens,vrv,joshl) - Fix to Android camera demo app window size detection (andrewharp) - Fix to support lookup table of high rank tensors (yleon) - Fix invalid op names for parse_example (dga) Base CL: 107531031
Diffstat (limited to 'tensorflow/python/kernel_tests/lookup_table_op_test.py')
-rw-r--r--tensorflow/python/kernel_tests/lookup_table_op_test.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tensorflow/python/kernel_tests/lookup_table_op_test.py b/tensorflow/python/kernel_tests/lookup_table_op_test.py
index cd170876e6..a6b91560f1 100644
--- a/tensorflow/python/kernel_tests/lookup_table_op_test.py
+++ b/tensorflow/python/kernel_tests/lookup_table_op_test.py
@@ -26,6 +26,25 @@ class HashTableOpTest(tf.test.TestCase):
result = output.eval()
self.assertAllEqual([0, 1, -1], result)
+ def testHashTableFindHighRank(self):
+ with self.test_session():
+ shared_name = ''
+ default_val = -1
+ table = tf.HashTable(tf.string, tf.int64, default_val, shared_name)
+
+ # Initialize with keys and values tensors.
+ keys = tf.constant(['brain', 'salad', 'surgery'])
+ values = tf.constant([0, 1, 2], tf.int64)
+ init = table.initialize_from(keys, values)
+ init.run()
+ self.assertAllEqual(3, table.size().eval())
+
+ input_string = tf.constant([['brain', 'salad'], ['tank', 'tarkus']])
+ output = table.lookup(input_string)
+
+ result = output.eval()
+ self.assertAllEqual([[0, 1], [-1, -1]], result)
+
def testHashTableInitWithPythonArrays(self):
with self.test_session():
shared_name = ''