@TensorType(dataType=DT_BOOL, byteSize=1, mapperClass=TBoolMapper.class) public interface TBool extends org.tensorflow.ndarray.BooleanNdArray, TType
If direct memory mapping is not available in the JVM, tensors of this type might require an
explicit mapping between Java boolean values and byte buffers using the BOOL
layout, which may impact I/O performances.
Modifier and Type | Method and Description |
---|---|
static TBool |
scalarOf(boolean value)
Allocates a new tensor for storing a single boolean value.
|
static TBool |
tensorOf(org.tensorflow.ndarray.NdArray<Boolean> src)
Allocates a new tensor which is a copy of a given array of booleans.
|
static TBool |
tensorOf(org.tensorflow.ndarray.Shape shape)
Allocates a new tensor of the given shape.
|
static TBool |
tensorOf(org.tensorflow.ndarray.Shape shape,
org.tensorflow.ndarray.buffer.BooleanDataBuffer data)
Allocates a new tensor of the given shape, initialized with the provided data.
|
static TBool |
tensorOf(org.tensorflow.ndarray.Shape shape,
Consumer<TBool> dataInit)
Allocates a new tensor of the given shape and initialize its data.
|
static TBool |
vectorOf(boolean... values)
Allocates a new tensor for storing a vector of booleans.
|
static TBool scalarOf(boolean value)
value
- boolean to store in the new tensorstatic TBool vectorOf(boolean... values)
values
- booleans to store in the new tensorstatic TBool tensorOf(org.tensorflow.ndarray.NdArray<Boolean> src)
The tensor will have the same shape as the source array and its data will be copied.
src
- the source array giving the shape and data to the new tensorstatic TBool tensorOf(org.tensorflow.ndarray.Shape shape)
shape
- shape of the tensor to allocatestatic TBool tensorOf(org.tensorflow.ndarray.Shape shape, org.tensorflow.ndarray.buffer.BooleanDataBuffer data)
shape
- shape of the tensor to allocatedata
- buffer of booleans to initialize the tensor withstatic TBool tensorOf(org.tensorflow.ndarray.Shape shape, Consumer<TBool> dataInit)
shape
- shape of the tensor to allocatedataInit
- tensor data initializerTensorFlowException
- if the tensor cannot be allocated or initializedCopyright © 2015–2022. All rights reserved.