Methods

__init__

It generates one key-value pair per line. The type of table key and
value are specified by key_dtype and value_dtype, respectively.
Similarly the content of the key and value are specified by the key_index
and value_index.

TextFileIndex.LINE_NUMBER means use the line number starting from zero,
expects data type int64.

A value >=0 means use the index (starting at zero) of the split line based
on delimiter.

Args:

filename: The filename of the text file to be used for initialization.
The path must be accessible from wherever the graph is initialized
(eg. trainer or eval workers). The filename may be a scalar Tensor.

key_dtype: The key data type.

key_index: the index that represents information of a line to get the
table 'key' values from.

value_dtype: The value data type.

value_index: the index that represents information of a line to get the
table 'value' values from.'

vocab_size: The number of elements in the file, if known.

delimiter: The delimiter to separate fields in a line.

name: A name for the operation (optional).

Raises:

ValueError: when the filename is empty, or when the table key and value
data types do not match the expected data types.

initialize

initialize(table)

Initializes the table from a text file.

Args:

table: The table to be initialized.

Returns:

The operation that initializes the table.

Raises:

TypeError: when the keys and values data types do not match the table
key and value data types.