InitializableLookupTableBase
Inherits From: LookupInterface
Defined in tensorflow/python/ops/lookup_ops.py.
Initializable lookup table interface.
An initializable lookup tables persist across different steps.
default_valueThe default value of the table.
initThe table initialization op.
key_dtypeThe table key dtype.
nameThe name of the table.
table_refGet the underlying table reference.
value_dtypeThe table value dtype.
__init____init__(
table_ref,
default_value,
initializer
)
Construct a table object from a table reference.
If requires a table initializer object (subclass of TableInitializerBase). It provides the table key and value types, as well as the op to initialize the table. The caller is responsible to execute the initialization op.
table_ref: The table reference, i.e. the output of the lookup table ops.default_value: The value to use if a key is missing in the table.initializer: The table initializer to use.lookuplookup(
keys,
name=None
)
Looks up keys in a table, outputs the corresponding values.
The default_value is used for keys not present in the table.
keys: Keys to look up. May be either a SparseTensor or dense Tensor.name: A name for the operation (optional).A SparseTensor if keys are sparse, otherwise a dense Tensor.
TypeError: when keys or default_value doesn't match the table data types.sizesize(name=None)
Compute the number of elements in this table.
name: A name for the operation (optional).A scalar tensor containing the number of elements in this table.
© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/lookup/InitializableLookupTableBase