Created
November 10, 2017 19:37
-
-
Save fac2003/c768a2c148e8f8dee03f867b45c05f27 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while (iterator.hasNext() && shouldWork.get()) { | |
DataSet smth = null; | |
if (useWorkspace) { | |
try (MemoryWorkspace ws = workspace.notifyScopeEntered()) { | |
smth = iterator.next(); | |
if (callback != null) | |
callback.call(smth); | |
} | |
} else { | |
smth = iterator.next(); | |
if (callback != null) | |
callback.call(smth); | |
} | |
// we want to ensure underlying iterator finished dataset creation | |
Nd4j.getExecutioner().commit(); | |
if (smth != null) | |
queue.put(smth); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment