public abstract class BaseDataBuffer extends java.lang.Object implements DataBuffer
DataBuffer.AllocationMode, DataBuffer.TypeEx
Modifier and Type | Field and Description |
---|---|
protected DataBuffer.AllocationMode |
allocationMode |
protected boolean |
attached |
protected boolean |
constant |
protected byte |
elementSize |
protected org.bytedeco.javacpp.indexer.Indexer |
indexer |
protected long |
length |
protected long |
offset |
protected DataBuffer |
originalBuffer |
protected long |
originalOffset |
protected MemoryWorkspace |
parentWorkspace |
protected org.bytedeco.javacpp.Pointer |
pointer |
protected org.nd4j.linalg.primitives.AtomicBoolean |
referenced |
protected boolean |
released |
static java.lang.String |
TO_STRING_MAX_ELEMENTS
Deprecated.
Use
ND4JSystemProperties.DATABUFFER_TO_STRING_MAX_ELEMENTS |
protected java.lang.Long |
trackingPoint |
protected DataType |
type |
protected long |
underlyingLength |
protected long |
workspaceGenerationId |
protected DataBuffer |
wrappedDataBuffer |
Modifier | Constructor and Description |
---|---|
|
BaseDataBuffer() |
|
BaseDataBuffer(byte[] data,
long length) |
|
BaseDataBuffer(java.nio.ByteBuffer buffer,
long length)
Create a data buffer from
the given length
|
|
BaseDataBuffer(java.nio.ByteBuffer buffer,
long length,
long offset)
Create a data buffer from
the given length
|
protected |
BaseDataBuffer(DataBuffer underlyingBuffer,
long length,
long offset)
Meant for creating another view of a buffer
|
|
BaseDataBuffer(double[] data) |
|
BaseDataBuffer(double[] data,
boolean copy) |
|
BaseDataBuffer(double[] data,
boolean copy,
long offset) |
|
BaseDataBuffer(double[] data,
boolean copy,
long offset,
MemoryWorkspace workspace) |
|
BaseDataBuffer(double[] data,
boolean copy,
MemoryWorkspace workspace) |
|
BaseDataBuffer(float[] data) |
|
BaseDataBuffer(float[] data,
boolean copy) |
|
BaseDataBuffer(float[] data,
boolean copy,
long offset) |
|
BaseDataBuffer(float[] data,
boolean copy,
long offset,
MemoryWorkspace workspace) |
|
BaseDataBuffer(float[] data,
boolean copy,
MemoryWorkspace workspace) |
|
BaseDataBuffer(float[] data,
MemoryWorkspace workspace) |
|
BaseDataBuffer(int[] data) |
|
BaseDataBuffer(int[] data,
boolean copy) |
|
BaseDataBuffer(int[] data,
boolean copy,
long offset) |
|
BaseDataBuffer(int[] data,
boolean copy,
MemoryWorkspace workspace) |
|
BaseDataBuffer(int length,
int elementSize,
long offset) |
protected |
BaseDataBuffer(long length)
Instantiate a buffer with the given length
|
|
BaseDataBuffer(long[] data,
boolean copy) |
|
BaseDataBuffer(long[] data,
boolean copy,
MemoryWorkspace workspace) |
protected |
BaseDataBuffer(long length,
boolean initialize) |
protected |
BaseDataBuffer(long length,
boolean initialize,
MemoryWorkspace workspace) |
|
BaseDataBuffer(long length,
int elementSize) |
|
BaseDataBuffer(org.bytedeco.javacpp.Pointer pointer,
org.bytedeco.javacpp.indexer.Indexer indexer,
long length)
Meant for creating another view of a buffer
|
Modifier and Type | Method and Description |
---|---|
void |
addReferencing(java.lang.String id)
Deprecated.
|
long |
address()
Returns the address of the pointer
|
org.bytedeco.javacpp.Pointer |
addressPointer()
Returns the address of the pointer wrapped in a Pointer
|
DataBuffer.AllocationMode |
allocationMode()
Allocation mode for buffers
|
java.lang.Object |
array()
Returns the backing array
of this buffer (if there is one)
|
byte[] |
asBytes()
Raw byte array storage
|
double[] |
asDouble()
Return the buffer as a double array
Relative to the datatype, this will either be a copy
or a reference.
|
float[] |
asFloat()
Return the buffer as a float array
Relative to the datatype, this will either be a copy
or a reference.
|
int[] |
asInt()
Return the buffer as an int array
Relative to the datatype, this will either be a copy
or a reference.
|
long[] |
asLong()
Return the buffer as an long array
Relative to the datatype, this will either be a copy
or a reference.
|
java.nio.ByteBuffer |
asNio()
Returns a view of this as an
nio byte buffer
|
java.nio.DoubleBuffer |
asNioDouble()
Returns a view of this as an
nio byte buffer
|
java.nio.FloatBuffer |
asNioFloat()
Returns a view of this as an
nio byte buffer
|
java.nio.IntBuffer |
asNioInt()
Returns a view of this as an
nio byte buffer
|
java.nio.LongBuffer |
asNioLong() |
void |
assign(DataBuffer... buffers)
Assign the given data buffers to this buffer
|
void |
assign(DataBuffer data)
Assign the contents of this buffer
to this buffer
|
void |
assign(long[] indices,
double[] data,
boolean contiguous)
Assign the given elements to the given indices
|
void |
assign(long[] indices,
double[] data,
boolean contiguous,
long inc)
Assign the given elements to the given indices
|
void |
assign(long[] indices,
float[] data,
boolean contiguous)
Assign the given elements to the given indices
|
void |
assign(long[] indices,
float[] data,
boolean contiguous,
long inc)
Assign the given elements to the given indices
|
void |
assign(long[] offsets,
long[] strides,
DataBuffer... buffers)
Assign the given buffers to this buffer
based on the given offsets and strides.
|
void |
assign(long[] offsets,
long[] strides,
long n,
DataBuffer... buffers)
Assign the given buffers to this buffer
based on the given offsets and strides.
|
void |
assign(java.lang.Number value)
Assign the given value to the buffer
|
void |
assign(java.lang.Number value,
long offset)
Assign the given value to the buffer
starting at offset
|
long |
capacity() |
void |
close()
This method releases exclusive off-heap resources uses by this DataBuffer instance.
|
boolean |
closeable()
This method checks, if this DataBuffer instalce can use close() method
|
void |
copyAtStride(DataBuffer buf,
long n,
long stride,
long yStride,
long offset,
long yOffset)
Copies from
the given buffer
at the specified stride
for up to n elements
|
abstract DataBuffer |
create(double[] data)
Create the data buffer
with respect to the given byte buffer
|
abstract DataBuffer |
create(float[] data)
Create the data buffer
with respect to the given byte buffer
|
abstract DataBuffer |
create(int[] data)
Create the data buffer
with respect to the given byte buffer
|
protected abstract DataBuffer |
create(long length)
Create with length
|
DataType |
dataType()
The data opType of the buffer
|
void |
destroy()
release all resources for this buffer
|
boolean |
dirty()
Deprecated.
|
protected void |
doReadObject(java.io.ObjectInputStream s) |
DataBuffer |
dup()
Return a copy of this buffer
|
boolean |
equals(java.lang.Object o) |
void |
flush()
Flush the data buffer
|
static short |
fromFloat(float v) |
double |
getDouble(long i)
Get element i in the buffer as a double
|
double[] |
getDoublesAt(long offset,
int length)
Get the doubles at a particular offset
|
double[] |
getDoublesAt(long offset,
long inc,
int length)
Get the doubles at a particular offset
|
int |
getElementSize()
The number of bytes for each individual element
|
float |
getFloat(long i)
Get element i in the buffer as a double
|
float[] |
getFloatsAt(long offset,
int length)
Get the doubles at a particular offset
|
float[] |
getFloatsAt(long offset,
long inc,
int length)
Get the doubles at a particular offset
|
long |
getGenerationId() |
int |
getInt(long i)
Get the int at the specified index
|
int[] |
getIntsAt(long offset,
int length)
Get the ints at a particular offset
|
int[] |
getIntsAt(long offset,
long inc,
int length)
Get the ints at a particular offset
|
long |
getLong(long i)
Get element i in the buffer as long value
|
long[] |
getLongsAt(long offset,
int length)
Get the longs at a particular offset
|
long[] |
getLongsAt(long offset,
long inc,
int length)
Get the long at a particular offset
|
java.lang.Number |
getNumber(long i)
Get element i in the buffer as a double
|
MemoryWorkspace |
getParentWorkspace()
This method returns Workspace this DataBuffer is attached to
|
protected short |
getShort(long i)
Special method for
|
java.lang.Long |
getTrackingPoint()
Returns tracking point for Allocator
PLEASE NOTE: Suitable & meaningful only for specific backends
|
int |
hashCode() |
org.bytedeco.javacpp.indexer.Indexer |
indexer()
Returns the indexer for the buffer
|
protected abstract void |
initTypeAndSize()
Initialize the opType of this buffer
|
boolean |
isAttached()
This method returns True, if this DataBuffer is attached to some workspace.
|
boolean |
isConstant()
This method returns whether this DataBuffer is constant, or not.
|
boolean |
isInScope()
This method checks, if given attached INDArray is still in scope of its parent Workspace
|
boolean |
isPersist()
Deprecated.
|
long |
length()
Returns the length of the buffer
|
protected void |
markReleased() |
long |
offset()
Returns the offset of the buffer
|
DataBuffer |
originalDataBuffer()
Original DataBuffer.
|
long |
originalOffset()
Returns the offset of the buffer relative to originalDataBuffer
|
void |
persist()
Deprecated.
|
protected void |
pickReferent(BaseDataBuffer referent) |
long |
platformAddress()
Returns the address of platform-specific pointer:
- for native backend that'll be host pointer
- for cuda backend that'll be device pointer
|
org.bytedeco.javacpp.Pointer |
pointer()
Returns an underlying pointer if one exists
|
void |
pointerIndexerByCurrentType(DataType currentType) |
void |
put(long i,
boolean element) |
void |
put(long i,
double element)
Assign an element in the buffer to the specified index
|
void |
put(long i,
float element)
Assign an element in the buffer to the specified index
|
void |
put(long i,
int element)
Assign an element in the buffer to the specified index
|
void |
put(long i,
long element) |
void |
putByDestinationType(long i,
java.lang.Number element,
DataType globalType) |
void |
read(java.io.DataInputStream s,
DataBuffer.AllocationMode allocMode,
long len,
DataType dtype) |
void |
read(java.io.InputStream is,
DataBuffer.AllocationMode allocationMode,
long length,
DataType dataType)
Write this buffer to the input stream.
|
protected void |
readContent(java.io.DataInputStream s,
DataType sourceType,
DataType thisType) |
static org.nd4j.linalg.primitives.Triple<DataBuffer.AllocationMode,java.lang.Long,DataType> |
readHeader(java.io.InputStream is) |
DataBuffer |
reallocate(long length)
Reallocate the native memory of the buffer
|
java.util.Collection<java.lang.String> |
references()
Deprecated.
|
protected void |
release() |
void |
removeReferencing(java.lang.String id)
Deprecated.
|
boolean |
sameUnderlyingData(DataBuffer buffer)
Returns true if the underlying data source
is the same for both buffers (referential equals)
|
void |
setConstant(boolean reallyConstant)
This method allows you to mark databuffer as constant.
|
void |
setData(boolean[] data) |
void |
setData(byte[] data) |
void |
setData(double[] data)
Set the data for this buffer
|
void |
setData(float[] data)
Set the data for this buffer
|
void |
setData(int[] data)
Set the data for this buffer
|
void |
setData(long[] data)
Set the data for this buffer
|
void |
setData(short[] data) |
protected void |
setIndexer(org.bytedeco.javacpp.indexer.Indexer indexer) |
protected void |
setNioBuffer() |
void |
setTrackingPoint(java.lang.Long trackingPoint)
Sets tracking point used by Allocator
PLEASE NOTE: Suitable & meaningful only for specific backends
|
float |
toFloat(int hbits) |
java.lang.String |
toString() |
DataBuffer |
underlyingDataBuffer()
Underlying buffer:
This is meant for a data buffer
to be a view of another data buffer
|
long |
underlyingLength()
Returns the length of the buffer
|
void |
unPersist()
Deprecated.
|
boolean |
wasClosed()
This method checks if array or its buffer was closed before
|
protected java.nio.ByteBuffer |
wrappedBuffer() |
void |
write(java.io.DataOutputStream out) |
void |
write(java.io.OutputStream dos)
Write this buffer to the output stream
|
public static java.lang.String TO_STRING_MAX_ELEMENTS
ND4JSystemProperties.DATABUFFER_TO_STRING_MAX_ELEMENTS
protected DataType type
protected long length
protected long underlyingLength
protected long offset
protected byte elementSize
protected transient DataBuffer wrappedDataBuffer
protected transient long workspaceGenerationId
protected DataBuffer.AllocationMode allocationMode
protected transient org.bytedeco.javacpp.Pointer pointer
protected transient org.bytedeco.javacpp.indexer.Indexer indexer
protected transient boolean attached
protected transient MemoryWorkspace parentWorkspace
protected transient DataBuffer originalBuffer
protected transient long originalOffset
protected transient java.lang.Long trackingPoint
protected transient boolean constant
protected transient boolean released
protected transient org.nd4j.linalg.primitives.AtomicBoolean referenced
public BaseDataBuffer()
public BaseDataBuffer(org.bytedeco.javacpp.Pointer pointer, org.bytedeco.javacpp.indexer.Indexer indexer, long length)
pointer
- the underlying buffer to create a view fromindexer
- the indexer for the pointerlength
- the length of the viewprotected BaseDataBuffer(DataBuffer underlyingBuffer, long length, long offset)
underlyingBuffer
- the underlying buffer to create a view fromlength
- the length of the viewoffset
- the offset for the viewpublic BaseDataBuffer(float[] data, boolean copy, long offset)
data
- copy
- public BaseDataBuffer(float[] data, boolean copy, long offset, MemoryWorkspace workspace)
public BaseDataBuffer(float[] data, boolean copy)
data
- copy
- public BaseDataBuffer(float[] data, boolean copy, MemoryWorkspace workspace)
public BaseDataBuffer(double[] data, boolean copy, MemoryWorkspace workspace)
public BaseDataBuffer(int[] data, boolean copy, MemoryWorkspace workspace)
public BaseDataBuffer(long[] data, boolean copy, MemoryWorkspace workspace)
public BaseDataBuffer(double[] data, boolean copy, long offset)
data
- copy
- public BaseDataBuffer(double[] data, boolean copy, long offset, MemoryWorkspace workspace)
public BaseDataBuffer(double[] data, boolean copy)
data
- copy
- public BaseDataBuffer(int[] data, boolean copy, long offset)
data
- copy
- public BaseDataBuffer(int[] data, boolean copy)
data
- copy
- public BaseDataBuffer(long[] data, boolean copy)
data
- copy
- public BaseDataBuffer(double[] data)
data
- public BaseDataBuffer(int[] data)
data
- public BaseDataBuffer(float[] data)
data
- public BaseDataBuffer(float[] data, MemoryWorkspace workspace)
public BaseDataBuffer(int length, int elementSize, long offset)
length
- elementSize
- public BaseDataBuffer(long length, int elementSize)
length
- elementSize
- public BaseDataBuffer(java.nio.ByteBuffer buffer, long length, long offset)
buffer
- length
- public BaseDataBuffer(java.nio.ByteBuffer buffer, long length)
buffer
- length
- public BaseDataBuffer(byte[] data, long length)
data
- length
- protected BaseDataBuffer(long length)
length
- the length of the bufferprotected BaseDataBuffer(long length, boolean initialize)
protected BaseDataBuffer(long length, boolean initialize, MemoryWorkspace workspace)
protected abstract void initTypeAndSize()
public int getElementSize()
DataBuffer
getElementSize
in interface DataBuffer
public long getGenerationId()
getGenerationId
in interface DataBuffer
protected void setIndexer(org.bytedeco.javacpp.indexer.Indexer indexer)
protected void pickReferent(BaseDataBuffer referent)
public DataBuffer originalDataBuffer()
originalDataBuffer
in interface DataBuffer
protected void setNioBuffer()
public org.bytedeco.javacpp.indexer.Indexer indexer()
indexer
in interface DataBuffer
public org.bytedeco.javacpp.Pointer pointer()
DataBuffer
pointer
in interface DataBuffer
public DataBuffer underlyingDataBuffer()
DataBuffer
underlyingDataBuffer
in interface DataBuffer
public long offset()
DataBuffer
offset
in interface DataBuffer
public DataBuffer.AllocationMode allocationMode()
DataBuffer
allocationMode
in interface DataBuffer
@Deprecated public void persist()
DataBuffer
persist
in interface DataBuffer
@Deprecated public boolean isPersist()
DataBuffer
isPersist
in interface DataBuffer
@Deprecated public void unPersist()
DataBuffer
unPersist
in interface DataBuffer
public void copyAtStride(DataBuffer buf, long n, long stride, long yStride, long offset, long yOffset)
DataBuffer
copyAtStride
in interface DataBuffer
buf
- the data buffer to copy fromn
- the number of elements to copystride
- the stride to copy at@Deprecated public void removeReferencing(java.lang.String id)
DataBuffer
removeReferencing
in interface DataBuffer
id
- the id to remove@Deprecated public java.util.Collection<java.lang.String> references()
DataBuffer
references
in interface DataBuffer
public org.bytedeco.javacpp.Pointer addressPointer()
DataBuffer
addressPointer
in interface DataBuffer
public long address()
DataBuffer
address
in interface DataBuffer
@Deprecated public void addReferencing(java.lang.String id)
DataBuffer
addReferencing
in interface DataBuffer
id
- the id to referencepublic void assign(long[] indices, float[] data, boolean contiguous, long inc)
DataBuffer
assign
in interface DataBuffer
indices
- the indices to assigndata
- the data to assigncontiguous
- whether the indices are contiguous or notinc
- the number to increment by when assigningpublic void setData(int[] data)
DataBuffer
setData
in interface DataBuffer
data
- the data for this bufferpublic void setData(float[] data)
DataBuffer
setData
in interface DataBuffer
data
- the data for this bufferpublic void setData(double[] data)
DataBuffer
setData
in interface DataBuffer
data
- the data for this bufferpublic void setData(long[] data)
DataBuffer
setData
in interface DataBuffer
data
- the data for this bufferpublic void setData(byte[] data)
setData
in interface DataBuffer
public void setData(short[] data)
setData
in interface DataBuffer
public void setData(boolean[] data)
setData
in interface DataBuffer
public void assign(long[] indices, double[] data, boolean contiguous, long inc)
DataBuffer
assign
in interface DataBuffer
indices
- the indices to assigndata
- the data to assigncontiguous
- whether the data is contiguous or notinc
- the number to increment by when assigningpublic void assign(DataBuffer data)
DataBuffer
assign
in interface DataBuffer
data
- the data to assignpublic void assign(long[] indices, float[] data, boolean contiguous)
DataBuffer
assign
in interface DataBuffer
indices
- the indices to assigndata
- the data to assigncontiguous
- whether the indices are contiguous or notpublic void assign(long[] indices, double[] data, boolean contiguous)
DataBuffer
assign
in interface DataBuffer
indices
- the indices to assigndata
- the data to assigncontiguous
- whether the data is contiguous or notpublic long underlyingLength()
DataBuffer
underlyingLength
in interface DataBuffer
public long length()
DataBuffer
length
in interface DataBuffer
public void assign(java.lang.Number value)
DataBuffer
assign
in interface DataBuffer
value
- the value to assignpublic double[] getDoublesAt(long offset, long inc, int length)
DataBuffer
getDoublesAt
in interface DataBuffer
offset
- the offset to startinc
- the increment to uselength
- the length of the arraypublic double[] getDoublesAt(long offset, int length)
DataBuffer
getDoublesAt
in interface DataBuffer
offset
- the offset to startlength
- the length of the arraypublic float[] getFloatsAt(long offset, int length)
DataBuffer
getFloatsAt
in interface DataBuffer
offset
- the offset to startlength
- the length of the arraypublic float[] getFloatsAt(long offset, long inc, int length)
DataBuffer
getFloatsAt
in interface DataBuffer
offset
- the offset to startinc
- the increment to uselength
- the length of the arraypublic long[] getLongsAt(long offset, int length)
DataBuffer
getLongsAt
in interface DataBuffer
offset
- the offset to startlength
- the length of the arraypublic long[] getLongsAt(long offset, long inc, int length)
DataBuffer
getLongsAt
in interface DataBuffer
offset
- the offset to startinc
- the increment to uselength
- the length of the arraypublic int[] getIntsAt(long offset, int length)
DataBuffer
getIntsAt
in interface DataBuffer
offset
- the offset to startlength
- the length of the arraypublic int[] getIntsAt(long offset, long inc, int length)
DataBuffer
getIntsAt
in interface DataBuffer
offset
- the offset to startinc
- the increment to uselength
- the length of the arraypublic DataBuffer dup()
DataBuffer
dup
in interface DataBuffer
protected abstract DataBuffer create(long length)
length
- a databuffer of the same opType as
this with the given lengthpublic abstract DataBuffer create(double[] data)
data
- the buffer to createpublic abstract DataBuffer create(float[] data)
data
- the buffer to createpublic abstract DataBuffer create(int[] data)
data
- the buffer to createpublic void assign(long[] offsets, long[] strides, DataBuffer... buffers)
DataBuffer
assign
in interface DataBuffer
offsets
- the offsets to usestrides
- the strides to usebuffers
- the buffers to assign data frompublic byte[] asBytes()
DataBuffer
asBytes
in interface DataBuffer
public float[] asFloat()
DataBuffer
asFloat
in interface DataBuffer
public double[] asDouble()
DataBuffer
asDouble
in interface DataBuffer
public int[] asInt()
DataBuffer
asInt
in interface DataBuffer
public long[] asLong()
DataBuffer
asLong
in interface DataBuffer
public double getDouble(long i)
DataBuffer
getDouble
in interface DataBuffer
i
- the element to getFloatpublic long getLong(long i)
DataBuffer
getLong
in interface DataBuffer
protected short getShort(long i)
i
- public static short fromFloat(float v)
v
- public float getFloat(long i)
DataBuffer
getFloat
in interface DataBuffer
i
- the element to getFloatpublic int getInt(long i)
DataBuffer
getInt
in interface DataBuffer
i
- the int at the specified indexpublic java.lang.Number getNumber(long i)
DataBuffer
getNumber
in interface DataBuffer
i
- the element to getFloatpublic void pointerIndexerByCurrentType(DataType currentType)
public void putByDestinationType(long i, java.lang.Number element, DataType globalType)
public void put(long i, float element)
DataBuffer
put
in interface DataBuffer
i
- the indexelement
- the element to assignpublic void put(long i, double element)
DataBuffer
put
in interface DataBuffer
i
- the indexelement
- the element to assignpublic void put(long i, int element)
DataBuffer
put
in interface DataBuffer
i
- the indexelement
- the element to assignpublic void put(long i, boolean element)
put
in interface DataBuffer
public void put(long i, long element)
put
in interface DataBuffer
@Deprecated public boolean dirty()
DataBuffer
dirty
in interface DataBuffer
public boolean sameUnderlyingData(DataBuffer buffer)
DataBuffer
sameUnderlyingData
in interface DataBuffer
buffer
- whether the buffer is the same underlying data or notprotected java.nio.ByteBuffer wrappedBuffer()
public java.nio.IntBuffer asNioInt()
DataBuffer
asNioInt
in interface DataBuffer
public java.nio.LongBuffer asNioLong()
asNioLong
in interface DataBuffer
public java.nio.DoubleBuffer asNioDouble()
DataBuffer
asNioDouble
in interface DataBuffer
public java.nio.FloatBuffer asNioFloat()
DataBuffer
asNioFloat
in interface DataBuffer
public java.nio.ByteBuffer asNio()
DataBuffer
asNio
in interface DataBuffer
public void assign(java.lang.Number value, long offset)
DataBuffer
assign
in interface DataBuffer
value
- assign the value to setoffset
- the offset to start atpublic void write(java.io.OutputStream dos)
DataBuffer
write
in interface DataBuffer
dos
- the output stream to writepublic void read(java.io.InputStream is, DataBuffer.AllocationMode allocationMode, long length, DataType dataType)
DataBuffer
read
in interface DataBuffer
is
- the inpus tream to write topublic void flush()
DataBuffer
flush
in interface DataBuffer
public void assign(long[] offsets, long[] strides, long n, DataBuffer... buffers)
DataBuffer
assign
in interface DataBuffer
offsets
- the offsets to usestrides
- the strides to usen
- the number of elements to operate onbuffers
- the buffers to assign data frompublic void assign(DataBuffer... buffers)
DataBuffer
assign
in interface DataBuffer
buffers
- the buffers to assignpublic void destroy()
DataBuffer
destroy
in interface DataBuffer
public DataType dataType()
dataType
in interface DataBuffer
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
protected void doReadObject(java.io.ObjectInputStream s)
public static org.nd4j.linalg.primitives.Triple<DataBuffer.AllocationMode,java.lang.Long,DataType> readHeader(@NonNull java.io.InputStream is)
public void read(java.io.DataInputStream s, @NonNull DataBuffer.AllocationMode allocMode, long len, @NonNull DataType dtype)
read
in interface DataBuffer
protected void readContent(java.io.DataInputStream s, DataType sourceType, DataType thisType)
public void write(java.io.DataOutputStream out) throws java.io.IOException
write
in interface DataBuffer
java.io.IOException
public float toFloat(int hbits)
public java.lang.Object array()
DataBuffer
array
in interface DataBuffer
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public long originalOffset()
originalOffset
in interface DataBuffer
public java.lang.Long getTrackingPoint()
getTrackingPoint
in interface DataBuffer
public void setTrackingPoint(java.lang.Long trackingPoint)
setTrackingPoint
in interface DataBuffer
trackingPoint
- public boolean isConstant()
isConstant
in interface DataBuffer
public void setConstant(boolean reallyConstant)
setConstant
in interface DataBuffer
reallyConstant
- public boolean isAttached()
isAttached
in interface DataBuffer
public boolean isInScope()
PLEASE NOTE: if this INDArray isn't attached to any Workspace, this method will return true
isInScope
in interface DataBuffer
public MemoryWorkspace getParentWorkspace()
DataBuffer
getParentWorkspace
in interface DataBuffer
public DataBuffer reallocate(long length)
reallocate
in interface DataBuffer
length
- the new length of the bufferpublic long capacity()
capacity
in interface DataBuffer
public boolean closeable()
DataBuffer
closeable
in interface DataBuffer
protected void markReleased()
public void close()
DataBuffer
close
in interface java.lang.AutoCloseable
close
in interface DataBuffer
protected void release()
public long platformAddress()
DataBuffer
platformAddress
in interface DataBuffer
public boolean wasClosed()
DataBuffer
wasClosed
in interface DataBuffer
Copyright © 2019. All rights reserved.