tf.compat.v1.IdentityReader

View source on GitHub

A Reader that outputs the queued work as both the key and value.

Inherits From: ReaderBase

tf.compat.v1.IdentityReader(
    name=None
)

To use, enqueue strings in a Queue. Read will take the front work string and output (work, work).

See ReaderBase for supported methods.

Args:

Attributes:

Eager Compatibility

Readers are not compatible with eager execution. Instead, please use tf.data to get data into your model.

Methods

num_records_produced

View source

num_records_produced(
    name=None
)

Returns the number of records this reader has produced.

This is the same as the number of Read executions that have succeeded.

Args:

Returns:

An int64 Tensor.

num_work_units_completed

View source

num_work_units_completed(
    name=None
)

Returns the number of work units this reader has finished processing.

Args:

Returns:

An int64 Tensor.

read

View source

read(
    queue, name=None
)

Returns the next record (key, value) pair produced by a reader.

Will dequeue a work unit from queue if necessary (e.g. when the Reader needs to start reading from a new file since it has finished with the previous file).

Args:

Returns:

A tuple of Tensors (key, value).

read_up_to

View source

read_up_to(
    queue, num_records, name=None
)

Returns up to num_records (key, value) pairs produced by a reader.

Will dequeue a work unit from queue if necessary (e.g., when the Reader needs to start reading from a new file since it has finished with the previous file). It may return less than num_records even before the last batch.

Args:

Returns:

A tuple of Tensors (keys, values).

reset

View source

reset(
    name=None
)

Restore a reader to its initial clean state.

Args:

Returns:

The created Operation.

restore_state

View source

restore_state(
    state, name=None
)

Restore a reader to a previously saved state.

Not all Readers support being restored, so this can produce an Unimplemented error.

Args:

Returns:

The created Operation.

serialize_state

View source

serialize_state(
    name=None
)

Produce a string tensor that encodes the state of a reader.

Not all Readers support being serialized, so this can produce an Unimplemented error.

Args:

Returns:

A string Tensor.