@TensorType(dataType=DT_FLOAT, byteSize=4, mapperClass=TFloat32Mapper.class) public interface TFloat32 extends org.tensorflow.ndarray.FloatNdArray, TFloating
Modifier and Type | Method and Description |
---|---|
static TFloat32 |
scalarOf(float value)
Allocates a new tensor for storing a single float value.
|
static TFloat32 |
tensorOf(org.tensorflow.ndarray.NdArray<Float> src)
Allocates a new tensor which is a copy of a given array of floats.
|
static TFloat32 |
tensorOf(org.tensorflow.ndarray.Shape shape)
Allocates a new tensor of the given shape.
|
static TFloat32 |
tensorOf(org.tensorflow.ndarray.Shape shape,
Consumer<TFloat32> dataInit)
Allocates a new tensor of the given shape and initialize its data.
|
static TFloat32 |
tensorOf(org.tensorflow.ndarray.Shape shape,
org.tensorflow.ndarray.buffer.FloatDataBuffer data)
Allocates a new tensor of the given shape, initialized with the provided data.
|
static TFloat32 |
vectorOf(float... values)
Allocates a new tensor for storing a vector of floats.
|
static TFloat32 scalarOf(float value)
value
- float to store in the new tensorstatic TFloat32 vectorOf(float... values)
values
- floats to store in the new tensorstatic TFloat32 tensorOf(org.tensorflow.ndarray.NdArray<Float> 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 TFloat32 tensorOf(org.tensorflow.ndarray.Shape shape)
shape
- shape of the tensor to allocatestatic TFloat32 tensorOf(org.tensorflow.ndarray.Shape shape, org.tensorflow.ndarray.buffer.FloatDataBuffer data)
shape
- shape of the tensor to allocatedata
- buffer of floats to initialize the tensor withstatic TFloat32 tensorOf(org.tensorflow.ndarray.Shape shape, Consumer<TFloat32> dataInit)
shape
- shape of the tensor to allocatedataInit
- tensor data initializerTensorFlowException
- if the tensor cannot be allocated or initializedCopyright © 2015–2022. All rights reserved.