From 97fe55e68bca159f1e2e7d5d5925f560edeac24e Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Thu, 13 Dec 2018 17:06:24 -0800 Subject: [PATCH] Fix docstring of lookup ops. PiperOrigin-RevId: 225462083 --- tensorflow/contrib/lookup/lookup_ops.py | 8 ++++---- tensorflow/python/ops/lookup_ops.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tensorflow/contrib/lookup/lookup_ops.py b/tensorflow/contrib/lookup/lookup_ops.py index e52fb5ab143..229a72a780d 100644 --- a/tensorflow/contrib/lookup/lookup_ops.py +++ b/tensorflow/contrib/lookup/lookup_ops.py @@ -91,7 +91,7 @@ def index_table_from_tensor(mapping, The bucket ID range is `[mapping size, mapping size + num_oov_buckets - 1]`. The underlying table must be initialized by calling - `tf.tables_initializer.run()` or `table.initializer.run()` once. + `session.run(tf.tables_initializer)` or `session.run(table.init)` once. Elements in `mapping` cannot have duplicates, otherwise when executing the table initializer op, it will throw a `FailedPreconditionError`. @@ -158,7 +158,7 @@ def string_to_index(tensor, mapping, default_value=-1, name=None): will throw a FailedPreconditionError. The underlying table must be initialized by calling - `tf.tables_initializer.run()` once. + `session.run(tf.tables_initializer)` once. For example: @@ -202,7 +202,7 @@ def index_to_string_table_from_tensor(mapping, default_value="UNK", name=None): (an out-of-vocabulary entry) is assigned the `default_value` The underlying table must be initialized by calling - `tf.tables_initializer.run()` or `table.initializer.run()` once. + `session.run(tf.tables_initializer)` or `session.run(table.init)` once. Elements in `mapping` cannot have duplicates, otherwise when executing the table initializer op, it will throw a `FailedPreconditionError`. @@ -257,7 +257,7 @@ def index_to_string(tensor, mapping, default_value="UNK", name=None): (an out-of-vocabulary entry) is assigned the `default_value` The underlying table must be initialized by calling - `tf.tables_initializer.run()` once. + `session.run(tf.tables_initializer)` once. For example: diff --git a/tensorflow/python/ops/lookup_ops.py b/tensorflow/python/ops/lookup_ops.py index 758cb8041da..e96c93c15c2 100644 --- a/tensorflow/python/ops/lookup_ops.py +++ b/tensorflow/python/ops/lookup_ops.py @@ -948,7 +948,7 @@ def index_table_from_file(vocabulary_file=None, `[vocabulary size, vocabulary size + num_oov_buckets - 1]`. The underlying table must be initialized by calling - `tf.tables_initializer.run()` or `table.init.run()` once. + `session.run(tf.tables_initializer)` or `session.run(table.init)` once. To specify multi-column vocabulary files, use key_column_index and value_column_index and delimiter. @@ -1077,7 +1077,7 @@ def index_table_from_tensor(vocabulary_list, `[vocabulary list size, vocabulary list size + num_oov_buckets - 1]`. The underlying table must be initialized by calling - `tf.tables_initializer.run()` or `table.init.run()` once. + `session.run(tf.tables_initializer)` or `session.run(table.init)` once. Elements in `vocabulary_list` cannot have duplicates, otherwise when executing the table initializer op, it will throw a `FailedPreconditionError`. @@ -1179,7 +1179,7 @@ def index_to_string_table_from_file(vocabulary_file, (an out-of-vocabulary entry) is assigned the `default_value` The underlying table must be initialized by calling - `tf.tables_initializer.run()` or `table.init.run()` once. + `session.run(tf.tables_initializer)` or `session.run(table.init)` once. To specify multi-column vocabulary files, use key_column_index and value_column_index and delimiter. @@ -1276,7 +1276,7 @@ def index_to_string_table_from_tensor(vocabulary_list, (an out-of-vocabulary entry) is assigned the `default_value` The underlying table must be initialized by calling - `tf.tables_initializer.run()` or `table.init.run()` once. + `session.run(tf.tables_initializer)` or `session.run(table.init)` once. Elements in `vocabulary_list` cannot have duplicates, otherwise when executing the table initializer op, it will throw a `FailedPreconditionError`.