- java.lang.Object
-
- org.tensorflow.ndarray.impl.AbstractNdArray<T,U>
-
- org.tensorflow.ndarray.impl.dense.AbstractDenseNdArray<Long,LongNdArray>
-
- org.tensorflow.ndarray.impl.dense.LongDenseNdArray
-
- All Implemented Interfaces:
LongNdArray,NdArray<Long>,Shaped
public class LongDenseNdArray extends AbstractDenseNdArray<Long,LongNdArray> implements LongNdArray
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedLongDenseNdArray(LongDataBuffer buffer, Shape shape)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LongDataBufferbuffer()LongNdArraycopyTo(NdArray<Long> dst)Copy the content of this array to the destination array.static LongNdArraycreate(LongDataBuffer buffer, Shape shape)longgetLong(long... indices)Returns the long value of the scalar found at the given coordinates.LongNdArrayread(LongDataBuffer dst)LongNdArraysetLong(long value, long... indices)Assigns the long value of the scalar found at the given coordinates.LongNdArraywrite(LongDataBuffer src)-
Methods inherited from class org.tensorflow.ndarray.impl.dense.AbstractDenseNdArray
elements, equals, get, getObject, hashCode, read, set, setObject, slice, slice, slowCopyTo, toString, write
-
Methods inherited from class org.tensorflow.ndarray.impl.AbstractNdArray
dimensions, scalars, shape, slowEquals, slowHashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.tensorflow.ndarray.LongNdArray
elements, get, getObject, read, scalars, set, setObject, slice, streamOfLongs, write
-
Methods inherited from interface org.tensorflow.ndarray.NdArray
equals, streamOfObjects
-
-
-
-
Constructor Detail
-
LongDenseNdArray
protected LongDenseNdArray(LongDataBuffer buffer, Shape shape)
-
-
Method Detail
-
create
public static LongNdArray create(LongDataBuffer buffer, Shape shape)
-
getLong
public long getLong(long... indices)
Description copied from interface:LongNdArrayReturns the long value of the scalar found at the given coordinates.To access the scalar element, the number of coordinates provided must be equal to the number of dimensions of this array (i.e. its rank). For example:
LongNdArray matrix = NdArrays.ofLongs(shape(2, 2)); // matrix rank = 2 matrix.getLong(0, 1); // succeeds, returns 0L matrix.getLong(0); // throws IllegalRankException LongNdArray scalar = matrix.get(0, 1); // scalar rank = 0 scalar.getLong(); // succeeds, returns 0L- Specified by:
getLongin interfaceLongNdArray- Parameters:
indices- coordinates of the scalar to resolve- Returns:
- value of that scalar
-
setLong
public LongNdArray setLong(long value, long... indices)
Description copied from interface:LongNdArrayAssigns the long value of the scalar found at the given coordinates.To access the scalar element, the number of coordinates provided must be equal to the number of dimensions of this array (i.e. its rank). For example:
LongNdArray matrix = NdArrays.ofLongs(shape(2, 2)); // matrix rank = 2 matrix.setLong(10L, 0, 1); // succeeds matrix.setLong(10L, 0); // throws IllegalRankException LongNdArray scalar = matrix.get(0, 1); // scalar rank = 0 scalar.setLong(10L); // succeeds- Specified by:
setLongin interfaceLongNdArray- Parameters:
value- value to assignindices- coordinates of the scalar to assign- Returns:
- this array
-
copyTo
public LongNdArray copyTo(NdArray<Long> dst)
Description copied from interface:NdArrayCopy the content of this array to the destination array.The
Shaped.shape()of the destination array must be equal to the shape of this array, or an exception is thrown. After the copy, the content of both arrays can be altered independently, without affecting each other.- Specified by:
copyToin interfaceLongNdArray- Specified by:
copyToin interfaceNdArray<Long>- Parameters:
dst- array to receive a copy of the content of this array- Returns:
- this array
-
read
public LongNdArray read(LongDataBuffer dst)
- Specified by:
readin interfaceLongNdArray
-
write
public LongNdArray write(LongDataBuffer src)
- Specified by:
writein interfaceLongNdArray
-
buffer
protected LongDataBuffer buffer()
- Specified by:
bufferin classAbstractDenseNdArray<Long,LongNdArray>
-
-