Class TensorFlowUtil.TensorTuple

java.lang.Object
org.tribuo.interop.tensorflow.TensorFlowUtil.TensorTuple
All Implemented Interfaces:
Serializable
Enclosing class:
TensorFlowUtil

public static final class TensorFlowUtil.TensorTuple extends Object implements Serializable
A serializable tuple containing the tensor class name, the shape and the data.

It's almost a record.

See Also:
  • Field Details

    • className

      public final String className
      The tensor class name.
    • shape

      public final long[] shape
      The shape of the tensor.
    • data

      public final byte[] data
      The tensor data.
  • Constructor Details

    • TensorTuple

      public TensorTuple(String className, long[] shape, byte[] data)
      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

      public static TensorFlowUtil.TensorTuple of(org.tensorflow.types.family.TType tensor)
      Makes a TensorTuple out of this tensor.
      Parameters:
      tensor - The tensor to serialize.
      Returns:
      A serializable form of the Tensor.