Class TfModel

java.lang.Object
ai.djl.BaseModel
ai.djl.tensorflow.engine.TfModel
All Implemented Interfaces:
ai.djl.Model, AutoCloseable

public class TfModel extends ai.djl.BaseModel
TfModel is the TensorFlow implementation of Model.
  • Field Summary

    Fields inherited from class ai.djl.BaseModel

    artifacts, block, dataType, inputData, manager, modelDir, modelName, properties, wasLoaded
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    ai.djl.nn.Block
    ai.djl.ndarray.NDManager
    void
    load(Path modelPath, String prefix, Map<String,?> options)
    void
    save(Path modelPath, String newModelName)
    void
    setBlock(ai.djl.nn.Block block)

    Methods inherited from class ai.djl.BaseModel

    describeInput, describeOutput, finalize, getArtifact, getArtifact, getArtifactAsStream, getDataType, getModelPath, getName, getProperties, getProperty, load, newPredictor, newTrainer, paramPathResolver, readParameters, setDataType, setModelDir, setProperty, toString

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface ai.djl.Model

    cast, getProperty, load, load, load, newPredictor, quantize
  • Method Details

    • load

      public void load(Path modelPath, String prefix, Map<String,?> options) throws FileNotFoundException, ai.djl.MalformedModelException
      Throws:
      FileNotFoundException
      ai.djl.MalformedModelException
    • save

      public void save(Path modelPath, String newModelName)
      Specified by:
      save in interface ai.djl.Model
      Overrides:
      save in class ai.djl.BaseModel
    • getBlock

      public ai.djl.nn.Block getBlock()
      Specified by:
      getBlock in interface ai.djl.Model
      Overrides:
      getBlock in class ai.djl.BaseModel
    • setBlock

      public void setBlock(ai.djl.nn.Block block)
      Specified by:
      setBlock in interface ai.djl.Model
      Overrides:
      setBlock in class ai.djl.BaseModel
    • getNDManager

      public ai.djl.ndarray.NDManager getNDManager()
      Specified by:
      getNDManager in interface ai.djl.Model
      Overrides:
      getNDManager in class ai.djl.BaseModel
    • getArtifactNames

      public String[] getArtifactNames()
      Specified by:
      getArtifactNames in interface ai.djl.Model
      Overrides:
      getArtifactNames in class ai.djl.BaseModel
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface ai.djl.Model
      Overrides:
      close in class ai.djl.BaseModel