public class AsyncMultiDataSetIterator extends Object implements org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator
Modifier and Type | Class and Description |
---|---|
protected class |
AsyncMultiDataSetIterator.AsyncPrefetchThread |
Modifier and Type | Field and Description |
---|---|
protected org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator |
backedIterator |
protected BlockingQueue<org.nd4j.linalg.dataset.api.MultiDataSet> |
buffer |
protected DataSetCallback |
callback |
protected Integer |
deviceId |
protected AtomicBoolean |
hasDepleted |
protected org.nd4j.linalg.dataset.api.MultiDataSet |
nextElement |
protected int |
prefetchSize |
protected AtomicBoolean |
shouldWork |
protected org.nd4j.linalg.dataset.api.MultiDataSet |
terminator |
protected AsyncMultiDataSetIterator.AsyncPrefetchThread |
thread |
protected RuntimeException |
throwable |
protected boolean |
useWorkspaces |
protected String |
workspaceId |
Modifier | Constructor and Description |
---|---|
protected |
AsyncMultiDataSetIterator() |
|
AsyncMultiDataSetIterator(org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator baseIterator) |
|
AsyncMultiDataSetIterator(org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator baseIterator,
int queueSize) |
|
AsyncMultiDataSetIterator(org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator iterator,
int queueSize,
BlockingQueue<org.nd4j.linalg.dataset.api.MultiDataSet> queue) |
|
AsyncMultiDataSetIterator(org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator iterator,
int queueSize,
BlockingQueue<org.nd4j.linalg.dataset.api.MultiDataSet> queue,
boolean useWorkspace) |
|
AsyncMultiDataSetIterator(org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator iterator,
int queueSize,
BlockingQueue<org.nd4j.linalg.dataset.api.MultiDataSet> queue,
boolean useWorkspace,
DataSetCallback callback) |
|
AsyncMultiDataSetIterator(org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator iterator,
int queueSize,
BlockingQueue<org.nd4j.linalg.dataset.api.MultiDataSet> queue,
boolean useWorkspace,
DataSetCallback callback,
Integer deviceId) |
|
AsyncMultiDataSetIterator(org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator baseIterator,
int queueSize,
boolean useWorkspace) |
|
AsyncMultiDataSetIterator(org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator baseIterator,
int queueSize,
boolean useWorkspace,
Integer deviceId) |
Modifier and Type | Method and Description |
---|---|
boolean |
asyncSupported()
Does this DataSetIterator support asynchronous prefetching of multiple DataSet objects?
Most DataSetIterators do, but in some cases it may not make sense to wrap this iterator in an
iterator that does asynchronous prefetching.
|
protected void |
externalCall() |
org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor |
getPreProcessor() |
boolean |
hasNext()
Returns
true if the iteration has more elements. |
org.nd4j.linalg.dataset.api.MultiDataSet |
next()
Returns the next element in the iteration.
|
org.nd4j.linalg.dataset.api.MultiDataSet |
next(int num)
Like the standard next method but allows a
customizable number of examples returned
|
void |
remove()
Removes from the underlying collection the last element returned
by this iterator (optional operation).
|
void |
reset()
Resets the iterator back to the beginning
|
boolean |
resetSupported()
Is resetting supported by this DataSetIterator? Many DataSetIterators do support resetting,
but some don't
|
void |
setPreProcessor(org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor preProcessor)
Set the preprocessor to be applied to each MultiDataSet, before each MultiDataSet is returned.
|
void |
shutdown()
This method will terminate background thread AND will destroy attached workspace (if any)
PLEASE NOTE: After shutdown() call, this instance can't be used anymore
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
protected org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator backedIterator
protected org.nd4j.linalg.dataset.api.MultiDataSet terminator
protected org.nd4j.linalg.dataset.api.MultiDataSet nextElement
protected BlockingQueue<org.nd4j.linalg.dataset.api.MultiDataSet> buffer
protected AsyncMultiDataSetIterator.AsyncPrefetchThread thread
protected AtomicBoolean shouldWork
protected volatile RuntimeException throwable
protected boolean useWorkspaces
protected int prefetchSize
protected String workspaceId
protected DataSetCallback callback
protected Integer deviceId
protected AtomicBoolean hasDepleted
protected AsyncMultiDataSetIterator()
public AsyncMultiDataSetIterator(org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator baseIterator)
public AsyncMultiDataSetIterator(org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator iterator, int queueSize, BlockingQueue<org.nd4j.linalg.dataset.api.MultiDataSet> queue)
public AsyncMultiDataSetIterator(org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator baseIterator, int queueSize)
public AsyncMultiDataSetIterator(org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator baseIterator, int queueSize, boolean useWorkspace)
public AsyncMultiDataSetIterator(org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator baseIterator, int queueSize, boolean useWorkspace, Integer deviceId)
public AsyncMultiDataSetIterator(org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator iterator, int queueSize, BlockingQueue<org.nd4j.linalg.dataset.api.MultiDataSet> queue, boolean useWorkspace)
public AsyncMultiDataSetIterator(org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator iterator, int queueSize, BlockingQueue<org.nd4j.linalg.dataset.api.MultiDataSet> queue, boolean useWorkspace, DataSetCallback callback)
public AsyncMultiDataSetIterator(org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator iterator, int queueSize, BlockingQueue<org.nd4j.linalg.dataset.api.MultiDataSet> queue, boolean useWorkspace, DataSetCallback callback, Integer deviceId)
public org.nd4j.linalg.dataset.api.MultiDataSet next(int num)
next
in interface org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator
num
- the number of examplespublic void setPreProcessor(org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor preProcessor)
setPreProcessor
in interface org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator
preProcessor
- MultiDataSetPreProcessor. May be null.public org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor getPreProcessor()
getPreProcessor
in interface org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator
public boolean resetSupported()
resetSupported
in interface org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator
public boolean asyncSupported()
asyncSupported
in interface org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator
public void reset()
reset
in interface org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator
public void shutdown()
public boolean hasNext()
true
if the iteration has more elements.
(In other words, returns true
if next(int)
would
return an element rather than throwing an exception.)public org.nd4j.linalg.dataset.api.MultiDataSet next()
public void remove()
next(int)
. The behavior of an iterator
is unspecified if the underlying collection is modified while the
iteration is in progress in any way other than by calling this
method.remove
in interface Iterator<org.nd4j.linalg.dataset.api.MultiDataSet>
UnsupportedOperationException
- if the remove
operation is not supported by this iteratorIllegalStateException
- if the next
method has not
yet been called, or the remove
method has already
been called after the last call to the next
methodprotected void externalCall()
Copyright © 2017. All rights reserved.