Class JitnnModel

java.lang.Object
ai.djl.BaseModel
ai.beestream.jitnn.djl.JitnnModel
All Implemented Interfaces:
ai.djl.Model, AutoCloseable

public final class JitnnModel extends ai.djl.BaseModel
A DJL model on jitNN. load reads an ONNX file (<prefix>.onnx in the model directory, the file itself, or the directory's only .onnx file) through jitnn-onnx; the option "fp16" = "true" runs its products in half precision. A model whose block was set in Java loads DJL's own parameter files instead.
  • 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
    Releases the model's weights before closing it, so that loading the same model again reuses the plans compiled for this one.
    void
    load(Path modelPath, String prefix, Map<String,?> options)
     
    ai.djl.training.Trainer
    newTrainer(ai.djl.training.TrainingConfig config)
     

    Methods inherited from class ai.djl.BaseModel

    describeInput, describeOutput, finalize, getArtifact, getArtifact, getArtifactAsStream, getArtifactNames, getBlock, getDataType, getModelPath, getName, getNDManager, getProperties, getProperty, load, loadBlock, newPredictor, paramPathResolver, readParameters, readParameters, save, setBlock, setDataType, setModelDir, setProperty, toString

    Methods inherited from class 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
    • close

      public void close()
      Releases the model's weights before closing it, so that loading the same model again reuses the plans compiled for this one.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface ai.djl.Model
      Overrides:
      close in class ai.djl.BaseModel
    • newTrainer

      public ai.djl.training.Trainer newTrainer(ai.djl.training.TrainingConfig config)
      Specified by:
      newTrainer in interface ai.djl.Model
      Overrides:
      newTrainer in class ai.djl.BaseModel