LostTech.TensorFlow : API Documentation

Type StaticHashTable

Namespace tensorflow.lookup

Parent StaticHashTable

Interfaces IStaticHashTable

A generic hash table that is immutable once initialized.

When running in graph mode, you must evaluate the tensor returned by `tf.tables_initializer()` before evaluating the tensor returned by this class's `lookup()` method. Example usage in graph mode: In eager mode, no special code is needed to initialize the table. Example usage in eager mode:
Show Example
keys_tensor = tf.constant([1, 2])
            vals_tensor = tf.constant([3, 4])
            input_tensor = tf.constant([1, 5])
            table = tf.lookup.StaticHashTable(
                tf.lookup.KeyValueTensorInitializer(keys_tensor, vals_tensor), -1)
            out = table.lookup(input_tensor)
            with tf.Session() as sess:
                sess.run(tf.tables_initializer())
                print(sess.run(out)) 

Properties

Public properties

object default_value get;

object default_value_dyn get;

object initializer get;

object initializer_dyn get;

DType key_dtype get;

object key_dtype_dyn get;

object name get;

object name_dyn get;

object PythonObject get;

Tensor resource_handle get;

object resource_handle_dyn get;

DType value_dtype get;

object value_dtype_dyn get;