- java.lang.Object
-
- org.tensorflow.ndarray.impl.buffer.layout.BoolLayout
-
- All Implemented Interfaces:
BooleanDataLayout<ByteDataBuffer>,DataLayout<ByteDataBuffer,Boolean>
public final class BoolLayout extends Object implements BooleanDataLayout<ByteDataBuffer>
Data layout that converts booleans from/to bytes.
-
-
Constructor Summary
Constructors Constructor Description BoolLayout()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanreadBoolean(ByteDataBuffer buffer, long index)Readsn = scale()values from the buffer at the given index and return them as a boolean.voidwriteBoolean(ByteDataBuffer buffer, boolean value, long index)Writes a boolean into the buffer at the given index after converting it to the buffer type.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.tensorflow.ndarray.buffer.layout.BooleanDataLayout
applyTo, readObject, writeObject
-
Methods inherited from interface org.tensorflow.ndarray.buffer.layout.DataLayout
scale
-
-
-
-
Method Detail
-
writeBoolean
public void writeBoolean(ByteDataBuffer buffer, boolean value, long index)
Description copied from interface:BooleanDataLayoutWrites a boolean into the buffer at the given index after converting it to the buffer type.- Specified by:
writeBooleanin interfaceBooleanDataLayout<ByteDataBuffer>- Parameters:
buffer- the buffer to write tovalue- the boolean to convert and writeindex- index in the buffer where the converted value should be written- See Also:
BooleanDataLayout.writeObject(DataBuffer, Boolean, long)
-
readBoolean
public boolean readBoolean(ByteDataBuffer buffer, long index)
Description copied from interface:BooleanDataLayoutReadsn = scale()values from the buffer at the given index and return them as a boolean.- Specified by:
readBooleanin interfaceBooleanDataLayout<ByteDataBuffer>- Parameters:
buffer- the buffer to read fromindex- position of the buffer to read in the buffer- Returns:
- the boolean value
- See Also:
BooleanDataLayout.readObject(DataBuffer, long)
-
-