/** * This method temporary opens block out of any workspace scope. * <p> * PLEASE NOTE: Do not forget to close this block. * * @return */ @Override public MemoryWorkspace scopeOutOfWorkspaces() { MemoryWorkspace workspace = Nd4j.getMemoryManager().getCurrentWorkspace(); if (workspace == null) return new DummyWorkspace(); else { Nd4j.getMemoryManager().setCurrentWorkspace(null); return workspace.tagOutOfScopeUse(); } }
/** * This method temporary opens block out of any workspace scope. * <p> * PLEASE NOTE: Do not forget to close this block. * * @return */ @Override public MemoryWorkspace scopeOutOfWorkspaces() { MemoryWorkspace workspace = Nd4j.getMemoryManager().getCurrentWorkspace(); if (workspace == null) return new DummyWorkspace(); else { Nd4j.getMemoryManager().setCurrentWorkspace(null); return workspace.tagOutOfScopeUse(); } }