MapDataset

public class MapDataset

Public Constructors

MapDataset(Dataset other, Function<List<Operand<?>>, List<Operand<?>>> mapper)

Public Methods

DatasetIterator
makeInitializeableIterator()
Creates a `DatasetIterator` that can be used to iterate over elements of this dataset.
DatasetIterator
makeOneShotIterator()
Creates a `DatasetIterator` that can be used to iterate over elements of this dataset.

Inherited Methods

Public Constructors

public MapDataset (Dataset other, Function<List<Operand<?>>, List<Operand<?>>> mapper)

Public Methods

public DatasetIterator makeInitializeableIterator ()

Creates a `DatasetIterator` that can be used to iterate over elements of this dataset.

This iterator will have to be initialized with a call to `iterator.makeInitializer(Dataset)` before elements can be retreived in a loop.

Returns
  • A new `DatasetIterator` based on this dataset's structure.

public DatasetIterator makeOneShotIterator ()

Creates a `DatasetIterator` that can be used to iterate over elements of this dataset. Using `makeOneShotIterator` ensures that the iterator is automatically initialized on this dataset. skips In graph mode, the initializer op will be added to the Graph's intitializer list, which must be run via `tf.init()`:

Ex:

     try (Session session = new Session(graph) {
         // Immediately run initializers
         session.run(tf.init());
     }
 

In eager mode, the initializer will be run automatically as a result of this call.

Returns
  • A new `DatasetIterator` based on this dataset's structure.