Package org.datavec.api.writable
Class NDArrayWritable
- java.lang.Object
-
- org.datavec.api.writable.ArrayWritable
-
- org.datavec.api.writable.NDArrayWritable
-
- All Implemented Interfaces:
Serializable,Comparable,WritableComparable,Writable
public class NDArrayWritable extends ArrayWritable implements WritableComparable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static byteNDARRAY_SER_VERSION_HEADERstatic byteNDARRAY_SER_VERSION_HEADER_NULL
-
Constructor Summary
Constructors Constructor Description NDArrayWritable()NDArrayWritable(INDArray array)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(@NonNull Object o)booleanequals(Object o)Returns true iffois a ArrayWritable with the same value.INDArrayget()doublegetDouble(long i)floatgetFloat(long i)intgetInt(long i)longgetLong(long i)WritableTypegetType()Get the type of the writable.inthashCode()longlength()voidreadFields(DataInput in)Deserialize into a row vector of default type.voidset(INDArray array)StringtoString()voidwrite(DataOutput out)Serialize array data linearly.voidwriteType(DataOutput out)Write the type (a single short value) to the DataOutput.-
Methods inherited from class org.datavec.api.writable.ArrayWritable
toDouble, toFloat, toInt, toLong
-
-
-
-
Field Detail
-
NDARRAY_SER_VERSION_HEADER_NULL
public static final byte NDARRAY_SER_VERSION_HEADER_NULL
- See Also:
- Constant Field Values
-
NDARRAY_SER_VERSION_HEADER
public static final byte NDARRAY_SER_VERSION_HEADER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NDArrayWritable
public NDArrayWritable()
-
NDArrayWritable
public NDArrayWritable(INDArray array)
-
-
Method Detail
-
readFields
public void readFields(DataInput in) throws IOException
Deserialize into a row vector of default type.- Specified by:
readFieldsin interfaceWritable- Parameters:
in-DataInputto deseriablize this object from.- Throws:
IOException
-
writeType
public void writeType(DataOutput out) throws IOException
Description copied from interface:WritableWrite the type (a single short value) to the DataOutput. SeeWritableFactoryfor details.- Specified by:
writeTypein interfaceWritable- Parameters:
out- DataOutput to write to- Throws:
IOException- For errors during writing
-
getType
public WritableType getType()
Description copied from interface:WritableGet the type of the writable.
-
write
public void write(DataOutput out) throws IOException
Serialize array data linearly.- Specified by:
writein interfaceWritable- Parameters:
out-DataOuputto serialize this object into.- Throws:
IOException
-
set
public void set(INDArray array)
-
get
public INDArray get()
-
equals
public boolean equals(Object o)
Returns true iffois a ArrayWritable with the same value.
-
compareTo
public int compareTo(@NonNull @NonNull Object o)- Specified by:
compareToin interfaceComparable
-
length
public long length()
- Specified by:
lengthin classArrayWritable
-
getDouble
public double getDouble(long i)
- Specified by:
getDoublein classArrayWritable
-
getFloat
public float getFloat(long i)
- Specified by:
getFloatin classArrayWritable
-
getInt
public int getInt(long i)
- Specified by:
getIntin classArrayWritable
-
getLong
public long getLong(long i)
- Specified by:
getLongin classArrayWritable
-
-