Type DenseHashTable
Namespace tensorflow.lookup.experimental
Parent LookupInterface
Interfaces IDenseHashTable
A generic mutable hash table implementation using tensors as backing store.  Data can be inserted by calling the insert method and removed by calling the
remove method. It does not support initialization via the init method.  It uses "open addressing" with quadratic reprobing to resolve collisions.
Compared to `MutableHashTable` the insert, remove and lookup operations in a
`DenseHashTable` are typically faster, but memory usage can be higher.
However, `DenseHashTable` does not require additional memory for
temporary tensors created during checkpointing and restore operations.  Example usage: 
		
		
			
  Show Example
  
			table = tf.lookup.DenseHashTable(key_dtype=tf.int64,
                                             value_dtype=tf.int64,
                                             default_value=-1,
                                             empty_key=0,
                                             deleted_key=-1)  sess.run(table.insert(keys, values))
out = table.lookup(query_keys)
print(out.eval()) 
Methods
Properties
Public instance methods
object erase(IGraphNodeBase keys, string name)
Removes `keys` and its associated values from the table.  If a key is not present in the table, it is silently ignored. 
			
				
			
				
		
	Parameters
- 
							
IGraphNodeBasekeys - Keys to remove. Can be a tensor of any shape. Must match the table's key type.
 - 
							
stringname - A name for the operation (optional).
 
Returns
- 
						
object - The created Operation.
 
object erase_dyn(object keys, object name)
Removes `keys` and its associated values from the table.  If a key is not present in the table, it is silently ignored. 
			
				
			
				
		
	Parameters
- 
							
objectkeys - Keys to remove. Can be a tensor of any shape. Must match the table's key type.
 - 
							
objectname - A name for the operation (optional).
 
Returns
- 
						
object - The created Operation.
 
object insert_or_assign(IGraphNodeBase keys, IGraphNodeBase values, string name)
Associates `keys` with `values`. 
			
				
			
				
		
	Parameters
- 
							
IGraphNodeBasekeys - Keys to insert. Can be a tensor of any shape. Must match the table's key type.
 - 
							
IGraphNodeBasevalues - Values to be associated with keys. Must be a tensor of the same shape as `keys` and match the table's value type.
 - 
							
stringname - A name for the operation (optional).
 
Returns
- 
						
object - The created Operation.
 
object insert_or_assign_dyn(object keys, object values, object name)
Associates `keys` with `values`. 
			
				
			
				
		
	Parameters
- 
							
objectkeys - Keys to insert. Can be a tensor of any shape. Must match the table's key type.
 - 
							
objectvalues - Values to be associated with keys. Must be a tensor of the same shape as `keys` and match the table's value type.
 - 
							
objectname - A name for the operation (optional).
 
Returns
- 
						
object - The created Operation.
 
object remove(IGraphNodeBase keys, string name)
Removes `keys` and its associated values from the table.  If a key is not present in the table, it is silently ignored. 
			
				
			
				
		
	Parameters
- 
							
IGraphNodeBasekeys - Keys to remove. Can be a tensor of any shape. Must match the table's key type.
 - 
							
stringname - A name for the operation (optional).
 
Returns
- 
						
object - The created Operation.
 
object remove_dyn(object keys, object name)
Removes `keys` and its associated values from the table.  If a key is not present in the table, it is silently ignored. 
			
				
			
				
		
	Parameters
- 
							
objectkeys - Keys to remove. Can be a tensor of any shape. Must match the table's key type.
 - 
							
objectname - A name for the operation (optional).
 
Returns
- 
						
object - The created Operation.
 
Public static methods
DenseHashTable NewDyn(object key_dtype, object value_dtype, object default_value, object empty_key, object deleted_key, object initial_num_buckets, ImplicitContainer<T> name, ImplicitContainer<T> checkpoint)
Creates an empty `DenseHashTable` object.  Creates a table, the type of its keys and values are specified by key_dtype
and value_dtype, respectively. 
			
				
			
				
		
	Parameters
- 
							
objectkey_dtype - the type of the key tensors.
 - 
							
objectvalue_dtype - the type of the value tensors.
 - 
							
objectdefault_value - The value to use if a key is missing in the table.
 - 
							
objectempty_key - the key to use to represent empty buckets internally. Must not be used in insert, remove or lookup operations.
 - 
							
objectdeleted_key - the key to use to represent deleted buckets internally. Must not be used in insert, remove or lookup operations and be different from the empty_key.
 - 
							
objectinitial_num_buckets - the initial number of buckets.
 - 
							
ImplicitContainer<T>name - A name for the operation (optional).
 - 
							
ImplicitContainer<T>checkpoint - if True, the contents of the table are saved to and restored from checkpoints. If `shared_name` is empty for a checkpointed table, it is shared using the table node name.
 
Returns
- 
						
DenseHashTable - A `DenseHashTable` object.
 
Public properties
DType key_dtype get;
object key_dtype_dyn get;
object name get;
The name of the table. 
		
	object name_dyn get;
The name of the table.