Interface TypeConverter<I,O>

Type Parameters:
I - the target input type
O - the target output type

public interface TypeConverter<I,O>
A {code TypeConverter} interface defines how data type is converted to Input/Output.
  • Method Details

    • getSupportedType

      ai.djl.util.Pair<Type,Type> getSupportedType()
      Returns the supported type.
      Returns:
      the supported type
    • toInput

      Input toInput(I in)
      Convert the data type to Input.
      Parameters:
      in - the input data
      Returns:
      the converted data
    • fromOutput

      O fromOutput(Output out) throws TranslateException
      Convert the Output to target data type.
      Parameters:
      out - the output data
      Returns:
      the converted data
      Throws:
      TranslateException