Class OrtModel

  • All Implemented Interfaces:
    ai.djl.Model, java.lang.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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      void load​(java.io.InputStream is, java.util.Map<java.lang.String,​?> options)
      void load​(java.nio.file.Path modelPath, java.lang.String prefix, java.util.Map<java.lang.String,​?> options)
      • Methods inherited from class ai.djl.BaseModel

        describeInput, describeOutput, finalize, getArtifact, getArtifact, getArtifactAsStream, getArtifactNames, getBlock, getDataType, getModelPath, getName, getNDManager, getProperty, newPredictor, newTrainer, paramPathResolver, 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, load, load, load, newPredictor, quantize
    • Method Detail

      • load

        public void load​(java.nio.file.Path modelPath,
                         java.lang.String prefix,
                         java.util.Map<java.lang.String,​?> options)
                  throws java.io.IOException,
                         ai.djl.MalformedModelException
        Throws:
        java.io.IOException
        ai.djl.MalformedModelException
      • load

        public void load​(java.io.InputStream is,
                         java.util.Map<java.lang.String,​?> options)
                  throws java.io.IOException,
                         ai.djl.MalformedModelException
        Specified by:
        load in interface ai.djl.Model
        Overrides:
        load in class ai.djl.BaseModel
        Throws:
        java.io.IOException
        ai.djl.MalformedModelException
      • close

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