Reputation: 10058
I heard that TF 2.0 will remove tf.contrib, what is the best alternative for tf.contrib.lookup.index_table_from_tensor
function in TF 1.12?
Upvotes: 3
Views: 1767
Reputation: 393
Much of the functionality in tf.contrib.lookup
has been migrated to tf.lookup
, though I do not believe there is a 1:1 mapping for tf.contrib.lookup.index_table_from_tensor
. To date, the available endpoints are:
KeyValueTensorInitializer
- table initializers given keys
and values
tensors.StaticHashTable
- a generic hash table implementation.StaticVocabularyTable
- string to ID table wrapper that assigns out-of-vocabulary keys to buckets.TextFileInitializer
- table initializers from a text file.experimental.DenseHashTable
- generic mutable hash table implementation using tensors as the backing store.You can find out more about tf.contrib
deprecation and functionality migration in the Sunsetting tf.contrib
RFC.
Upvotes: 4