- java.lang.Object
-
- org.tensorflow.ndarray.impl.AbstractNdArray<T,U>
-
- org.tensorflow.ndarray.impl.dense.AbstractDenseNdArray<Short,ShortNdArray>
-
- org.tensorflow.ndarray.impl.dense.ShortDenseNdArray
-
- All Implemented Interfaces:
NdArray<Short>,Shaped,ShortNdArray
public class ShortDenseNdArray extends AbstractDenseNdArray<Short,ShortNdArray> implements ShortNdArray
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedShortDenseNdArray(ShortDataBuffer buffer, Shape shape)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ShortDataBufferbuffer()ShortNdArraycopyTo(NdArray<Short> dst)Copy the content of this array to the destination array.static ShortNdArraycreate(ShortDataBuffer buffer, Shape shape)shortgetShort(long... indices)Returns the short value of the scalar found at the given coordinates.ShortNdArrayread(ShortDataBuffer dst)ShortNdArraysetShort(short value, long... indices)Assigns the short value of the scalar found at the given coordinates.ShortNdArraywrite(ShortDataBuffer 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.NdArray
equals, streamOfObjects
-
-
-
-
Constructor Detail
-
ShortDenseNdArray
protected ShortDenseNdArray(ShortDataBuffer buffer, Shape shape)
-
-
Method Detail
-
create
public static ShortNdArray create(ShortDataBuffer buffer, Shape shape)
-
getShort
public short getShort(long... indices)
Description copied from interface:ShortNdArrayReturns the short 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:
ShortNdArray matrix = NdArrays.ofShorts(shape(2, 2)); // matrix rank = 2 matrix.getShort(0, 1); // succeeds, returns 0.0f matrix.getShort(0); // throws IllegalRankException ShortNdArray scalar = matrix.get(0, 1); // scalar rank = 0 scalar.getShort(); // succeeds, returns 0.0f- Specified by:
getShortin interfaceShortNdArray- Parameters:
indices- coordinates of the scalar to resolve- Returns:
- value of that scalar
-
setShort
public ShortNdArray setShort(short value, long... indices)
Description copied from interface:ShortNdArrayAssigns the short 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:
ShortNdArray matrix = NdArrays.ofShorts(shape(2, 2)); // matrix rank = 2 matrix.setShort(10.0f, 0, 1); // succeeds matrix.setShort(10.0f, 0); // throws IllegalRankException ShortNdArray scalar = matrix.get(0, 1); // scalar rank = 0 scalar.setShort(10.0f); // succeeds- Specified by:
setShortin interfaceShortNdArray- Parameters:
value- value to assignindices- coordinates of the scalar to assign- Returns:
- this array
-
copyTo
public ShortNdArray copyTo(NdArray<Short> 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 interfaceNdArray<Short>- Specified by:
copyToin interfaceShortNdArray- Parameters:
dst- array to receive a copy of the content of this array- Returns:
- this array
-
read
public ShortNdArray read(ShortDataBuffer dst)
- Specified by:
readin interfaceShortNdArray
-
write
public ShortNdArray write(ShortDataBuffer src)
- Specified by:
writein interfaceShortNdArray
-
buffer
protected ShortDataBuffer buffer()
- Specified by:
bufferin classAbstractDenseNdArray<Short,ShortNdArray>
-
-