Maps native tensor memory into DataBuffers
, allowing I/O operations from the JVM.
Public Constructors
Public Methods
static BooleanDataBuffer | |
static ByteDataBuffer | |
static ByteDataBuffer | |
static DoubleDataBuffer | |
static FloatDataBuffer | |
static IntDataBuffer | |
static LongDataBuffer | |
static ShortDataBuffer | |
static ByteSequenceTensorBuffer |
Inherited Methods
Public Constructors
public TensorBuffers ()
Public Methods
public static BooleanDataBuffer toBooleans (TF_Tensor nativeTensor)
Maps tensor memory as a buffer of booleans.
Parameters
nativeTensor | native reference to the tensor |
---|
Returns
- a boolean buffer
public static ByteDataBuffer toBytes (TF_Tensor nativeTensor)
Maps tensor memory as a buffer of bytes.
Parameters
nativeTensor | native reference to the tensor |
---|
Returns
- a byte buffer
public static ByteDataBuffer toBytes (TF_Tensor nativeTensor, boolean readOnly)
Maps tensor memory as a buffer of bytes.
Parameters
nativeTensor | native reference to the tensor |
---|---|
readOnly | true to return a read-only buffer |
Returns
- a byte buffer
public static DoubleDataBuffer toDoubles (TF_Tensor nativeTensor)
Maps tensor memory as a buffer of doubles.
Parameters
nativeTensor | native reference to the tensor |
---|
Returns
- a double buffer
public static FloatDataBuffer toFloats (TF_Tensor nativeTensor)
Maps tensor memory as a buffer of floats.
Parameters
nativeTensor | native reference to the tensor |
---|
Returns
- a float buffer
public static IntDataBuffer toInts (TF_Tensor nativeTensor)
Maps tensor memory as a buffer of integers.
Parameters
nativeTensor | native reference to the tensor |
---|
Returns
- an int buffer
public static LongDataBuffer toLongs (TF_Tensor nativeTensor)
Maps tensor memory as a buffer of longs.
Parameters
nativeTensor | native reference to the tensor |
---|
Returns
- a long buffer
public static ShortDataBuffer toShorts (TF_Tensor nativeTensor)
Maps tensor memory as a buffer of shorts.
Parameters
nativeTensor | native reference to the tensor |
---|
Returns
- a short buffer
public static ByteSequenceTensorBuffer toStrings (TF_Tensor nativeTensor, long numElements)
Maps tensor memory as a buffer of byte sequences, often used to store string values.
Parameters
nativeTensor | native reference to the tensor |
---|
Returns
- a string buffer