diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-04-23 15:56:12 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-04-23 15:59:06 -0700 |
commit | bb4a80c92105426ccf20a98c4291a1a3f8499b54 (patch) | |
tree | 4ea1670905182d4bda5109dff1a1053e666fec4b /tensorflow/contrib/lookup | |
parent | c8a1eeb98ca394d0330bead37b446bce998bb3d5 (diff) |
Implement exporting the keys/values in a hash table.
PiperOrigin-RevId: 193999421
Diffstat (limited to 'tensorflow/contrib/lookup')
-rw-r--r-- | tensorflow/contrib/lookup/lookup_ops_test.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tensorflow/contrib/lookup/lookup_ops_test.py b/tensorflow/contrib/lookup/lookup_ops_test.py index f681b7b132..5d4682ec9f 100644 --- a/tensorflow/contrib/lookup/lookup_ops_test.py +++ b/tensorflow/contrib/lookup/lookup_ops_test.py @@ -58,6 +58,12 @@ class HashTableOpTest(test.TestCase): result = output.eval() self.assertAllEqual([0, 1, -1], result) + exported_keys_tensor, exported_values_tensor = table.export() + + self.assertItemsEqual([b"brain", b"salad", b"surgery"], + exported_keys_tensor.eval()) + self.assertItemsEqual([0, 1, 2], exported_values_tensor.eval()) + def testHashTableFindHighRank(self): with self.test_session(): default_val = -1 |