- java.lang.Object
-
- org.tensorflow.ndarray.impl.AbstractNdArray<T,U>
-
- org.tensorflow.ndarray.impl.dense.AbstractDenseNdArray<Boolean,BooleanNdArray>
-
- org.tensorflow.ndarray.impl.dense.BooleanDenseNdArray
-
- All Implemented Interfaces:
BooleanNdArray,NdArray<Boolean>,Shaped
public class BooleanDenseNdArray extends AbstractDenseNdArray<Boolean,BooleanNdArray> implements BooleanNdArray
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBooleanDenseNdArray(BooleanDataBuffer buffer, Shape shape)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BooleanDataBufferbuffer()BooleanNdArraycopyTo(NdArray<Boolean> dst)Copy the content of this array to the destination array.static BooleanNdArraycreate(BooleanDataBuffer buffer, Shape shape)booleangetBoolean(long... indices)Returns the boolean value of the scalar found at the given coordinates.BooleanNdArrayread(BooleanDataBuffer dst)BooleanNdArraysetBoolean(boolean value, long... indices)Assigns the boolean value of the scalar found at the given coordinates.BooleanNdArraywrite(BooleanDataBuffer 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.BooleanNdArray
elements, get, getObject, read, scalars, set, setObject, slice, write
-
Methods inherited from interface org.tensorflow.ndarray.NdArray
equals, streamOfObjects
-
-
-
-
Constructor Detail
-
BooleanDenseNdArray
protected BooleanDenseNdArray(BooleanDataBuffer buffer, Shape shape)
-
-
Method Detail
-
create
public static BooleanNdArray create(BooleanDataBuffer buffer, Shape shape)
-
getBoolean
public boolean getBoolean(long... indices)
Description copied from interface:BooleanNdArrayReturns the boolean 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:
BooleanNdArray matrix = NdArrays.ofBooleans(shape(2, 2)); // matrix rank = 2 matrix.getBoolean(0, 1); // succeeds, returns false matrix.getBoolean(0); // throws IllegalRankException BooleanNdArray scalar = matrix.get(0, 1); // scalar rank = 0 scalar.getBoolean(); // succeeds, returns false- Specified by:
getBooleanin interfaceBooleanNdArray- Parameters:
indices- coordinates of the scalar to resolve- Returns:
- value of that scalar
-
setBoolean
public BooleanNdArray setBoolean(boolean value, long... indices)
Description copied from interface:BooleanNdArrayAssigns the boolean 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:
BooleanNdArray matrix = NdArrays.ofBooleans(shape(2, 2)); // matrix rank = 2 matrix.setBoolean(true, 0, 1); // succeeds matrix.setBoolean(true, 0); // throws IllegalRankException BooleanNdArray scalar = matrix.get(0, 1); // scalar rank = 0 scalar.setBoolean(true); // succeeds- Specified by:
setBooleanin interfaceBooleanNdArray- Parameters:
value- the value to assignindices- coordinates of the scalar to assign- Returns:
- this array
-
copyTo
public BooleanNdArray copyTo(NdArray<Boolean> 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 interfaceBooleanNdArray- Specified by:
copyToin interfaceNdArray<Boolean>- Parameters:
dst- array to receive a copy of the content of this array- Returns:
- this array
-
read
public BooleanNdArray read(BooleanDataBuffer dst)
- Specified by:
readin interfaceBooleanNdArray
-
write
public BooleanNdArray write(BooleanDataBuffer src)
- Specified by:
writein interfaceBooleanNdArray
-
buffer
protected BooleanDataBuffer buffer()
- Specified by:
bufferin classAbstractDenseNdArray<Boolean,BooleanNdArray>
-
-