Class OrtModel

java.lang.Object
ai.djl.BaseModel
ai.djl.onnxruntime.engine.OrtModel
All Implemented Interfaces:
ai.djl.Model, AutoCloseable

public class OrtModel extends ai.djl.BaseModel
OrtModel is the ONNX Runtime implementation of Model.

OrtModel contains all the methods in Model to load and process a model. In addition, it provides ONNX Runtime Specific functionality

  • 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
    void
    load(InputStream is, Map<String,?> options)
    void
    load(Path modelPath, String prefix, Map<String,?> options)

    Methods inherited from class ai.djl.BaseModel

    describeInput, describeOutput, finalize, getArtifact, getArtifact, getArtifactAsStream, getArtifactNames, getBlock, getDataType, getModelPath, getName, getNDManager, getProperties, getProperty, newPredictor, newTrainer, paramPathResolver, readParameters, readParameters, save, setBlock, 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, intProperty, load, load, load, longProperty, newPredictor, quantize
  • Method Details

    • load

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

      public void load(InputStream is, Map<String,?> options) throws IOException, ai.djl.MalformedModelException
      Specified by:
      load in interface ai.djl.Model
      Overrides:
      load in class ai.djl.BaseModel
      Throws:
      IOException
      ai.djl.MalformedModelException
    • 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