Class TfDataType

java.lang.Object
ai.djl.tensorflow.engine.TfDataType

public final class TfDataType extends Object
Helper to convert between DataType an the TensorFlow internal DataTypes.
  • Method Summary

    Modifier and Type
    Method
    Description
    static ai.djl.ndarray.types.DataType
    fromTf(int dataType)
    Converts a TensorFlow type value into a DataType.
    static int
    toTf(ai.djl.ndarray.types.DataType dataType)
    Converts a DataType into the corresponding TensorFlow type value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • toTf

      public static int toTf(ai.djl.ndarray.types.DataType dataType)
      Converts a DataType into the corresponding TensorFlow type value.
      Parameters:
      dataType - the DataType to convert
      Returns:
      the converted TensorFlow type value
    • fromTf

      public static ai.djl.ndarray.types.DataType fromTf(int dataType)
      Converts a TensorFlow type value into a DataType.
      Parameters:
      dataType - the TensorFlow type value to convert
      Returns:
      the DataType