Package org.tribuo.interop.tensorflow
Class TensorFlowUtil.TensorTuple
java.lang.Object
org.tribuo.interop.tensorflow.TensorFlowUtil.TensorTuple
- All Implemented Interfaces:
Serializable
- Enclosing class:
- TensorFlowUtil
A serializable tuple containing the tensor class name, the shape and the data.
It's almost a record.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTensorTuple
(String className, long[] shape, byte[] data) Makes a TensorTuple. -
Method Summary
Modifier and TypeMethodDescriptionstatic TensorFlowUtil.TensorTuple
of
(org.tensorflow.types.family.TType tensor) Makes a TensorTuple out of this tensor.org.tensorflow.Tensor
Recreates the Tensor from the serialized form.
-
Field Details
-
className
The tensor class name. -
shape
public final long[] shapeThe shape of the tensor. -
data
public final byte[] dataThe tensor data.
-
-
Constructor Details
-
TensorTuple
Makes a TensorTuple.- Parameters:
className
- The tensor class name.shape
- The dimensions of the tensor.data
- The data in the tensor.
-
-
Method Details
-
rebuildTensor
public org.tensorflow.Tensor rebuildTensor()Recreates the Tensor from the serialized form.- Returns:
- The Tensor.
-
of
Makes a TensorTuple out of this tensor.- Parameters:
tensor
- The tensor to serialize.- Returns:
- A serializable form of the Tensor.
-