Class NoOpMemoryMgr
- java.lang.Object
-
- org.nd4j.autodiff.samediff.internal.memory.AbstractMemoryMgr
-
- org.nd4j.autodiff.samediff.internal.memory.NoOpMemoryMgr
-
- All Implemented Interfaces:
Closeable,AutoCloseable,SessionMemMgr
public class NoOpMemoryMgr extends AbstractMemoryMgr implements SessionMemMgr
-
-
Constructor Summary
Constructors Constructor Description NoOpMemoryMgr()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description INDArrayallocate(boolean detached, DataType dataType, long... shape)Allocate an array with the specified datatype and shape.
NOTE: This array should be assumed to be uninitialized - i.e., contains random values.INDArrayallocate(boolean detached, LongShapeDescriptor descriptor)As perSessionMemMgr.allocate(boolean, DataType, long...)but from a LongShapeDescriptor insteadvoidclose()Close the session memory manager and clean up any memory / resources, if anyvoidrelease(@NonNull INDArray array)Release the array.-
Methods inherited from class org.nd4j.autodiff.samediff.internal.memory.AbstractMemoryMgr
dup, ulike
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nd4j.autodiff.samediff.internal.SessionMemMgr
dup, ulike
-
-
-
-
Method Detail
-
allocate
public INDArray allocate(boolean detached, DataType dataType, long... shape)
Description copied from interface:SessionMemMgrAllocate an array with the specified datatype and shape.
NOTE: This array should be assumed to be uninitialized - i.e., contains random values.- Specified by:
allocatein interfaceSessionMemMgr- Parameters:
detached- If true: the array is safe to return outside of the SameDiff session run (for example, the array is one that may be returned to the user)dataType- Datatype of the returned arrayshape- Array shape- Returns:
- The newly allocated (uninitialized) array
-
allocate
public INDArray allocate(boolean detached, LongShapeDescriptor descriptor)
Description copied from interface:SessionMemMgrAs perSessionMemMgr.allocate(boolean, DataType, long...)but from a LongShapeDescriptor instead- Specified by:
allocatein interfaceSessionMemMgr
-
release
public void release(@NonNull @NonNull INDArray array)Description copied from interface:SessionMemMgrRelease the array. All arrays allocated via one of the allocate methods should be returned here once they are no longer used, and all references to them should be cleared. After calling release, anything could occur to the array - deallocated, workspace closed, reused, etc.- Specified by:
releasein interfaceSessionMemMgr- Parameters:
array- The array that can be released
-
close
public void close()
Description copied from interface:SessionMemMgrClose the session memory manager and clean up any memory / resources, if any- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceSessionMemMgr
-
-