public abstract class NativeResource
extends java.lang.Object
implements java.lang.AutoCloseable
NativeResource
is an internal class for AutoCloseable
blocks of memory created in
the PyTorch Engine.Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.atomic.AtomicReference<Pointer> |
handle |
Modifier | Constructor and Description |
---|---|
protected |
NativeResource(Pointer pointer) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
finalize() |
protected Pointer |
getHandle()
Gets the
Pointer to this resource. |
java.lang.String |
getUid()
Gets the unique ID of this resource.
|
boolean |
isReleased()
Gets the boolean that indicates whether this resource has been released.
|
protected final java.util.concurrent.atomic.AtomicReference<Pointer> handle
protected NativeResource(Pointer pointer)
public boolean isReleased()
protected Pointer getHandle()
Pointer
to this resource.Pointer
to this resourcepublic final java.lang.String getUid()
public void close()
close
in interface java.lang.AutoCloseable
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable