public class NDArrayWritable extends ArrayWritable implements WritableComparable
Modifier and Type | Field and Description |
---|---|
static byte |
NDARRAY_SER_VERSION_HEADER |
static byte |
NDARRAY_SER_VERSION_HEADER_NULL |
Constructor and Description |
---|
NDArrayWritable() |
NDArrayWritable(org.nd4j.linalg.api.ndarray.INDArray array) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object o) |
boolean |
equals(Object o)
Returns true iff
o is a ArrayWritable with the same value. |
org.nd4j.linalg.api.ndarray.INDArray |
get() |
double |
getDouble(long i) |
float |
getFloat(long i) |
int |
getInt(long i) |
long |
getLong(long i) |
WritableType |
getType()
Get the type of the writable.
|
int |
hashCode() |
long |
length() |
void |
readFields(DataInput in)
Deserialize into a row vector of default type.
|
void |
set(org.nd4j.linalg.api.ndarray.INDArray array) |
String |
toString() |
void |
write(DataOutput out)
Serialize array data linearly.
|
void |
writeType(DataOutput out)
Write the type (a single short value) to the DataOutput.
|
toDouble, toFloat, toInt, toLong
public static final byte NDARRAY_SER_VERSION_HEADER_NULL
public static final byte NDARRAY_SER_VERSION_HEADER
public NDArrayWritable()
public NDArrayWritable(org.nd4j.linalg.api.ndarray.INDArray array)
public void readFields(DataInput in) throws IOException
readFields
in interface Writable
in
- DataInput
to deseriablize this object from.IOException
public void writeType(DataOutput out) throws IOException
Writable
WritableFactory
for details.writeType
in interface Writable
out
- DataOutput to write toIOException
- For errors during writingpublic WritableType getType()
Writable
public void write(DataOutput out) throws IOException
write
in interface Writable
out
- DataOuput
to serialize this object into.IOException
public void set(org.nd4j.linalg.api.ndarray.INDArray array)
public org.nd4j.linalg.api.ndarray.INDArray get()
public boolean equals(Object o)
o
is a ArrayWritable with the same value.public int compareTo(@NotNull Object o)
compareTo
in interface Comparable
public long length()
length
in class ArrayWritable
public double getDouble(long i)
getDouble
in class ArrayWritable
public float getFloat(long i)
getFloat
in class ArrayWritable
public int getInt(long i)
getInt
in class ArrayWritable
public long getLong(long i)
getLong
in class ArrayWritable
Copyright © 2018. All rights reserved.