Class OnnxModelInfo

java.lang.Object
com.yahoo.vespa.model.ml.OnnxModelInfo

public class OnnxModelInfo extends Object
Model information (input and output types) for an ONNX model. This encapsulates the difference between reading ONNX model information - from a file application package, where we can read the ONNX model directly - from a ZK application package, where the file is unavailable and models are read from generated files stored in file distribution or ZooKeeper.
Author:
lesters
  • Method Details

    • getModelPath

      public String getModelPath()
    • getInputs

      public Set<String> getInputs()
    • getOutputs

      public Set<String> getOutputs()
    • getDefaultOutput

      public String getDefaultOutput()
    • getTensorType

      public com.yahoo.tensor.TensorType getTensorType(String onnxName, Map<String,com.yahoo.tensor.TensorType> inputTypes)
      Return the tensor type for an ONNX model for the given context. An ONNX model can have dynamic/symbolic dimension sizes. If so, the output type depends on the input types for the given context (rank profile).
    • load

      public static OnnxModelInfo load(String path, com.yahoo.config.application.api.ApplicationPackage app)
    • modelExists

      public static boolean modelExists(String path, com.yahoo.config.application.api.ApplicationPackage app)
    • jsonToModelInfo

      public static OnnxModelInfo jsonToModelInfo(String json, com.yahoo.config.application.api.ApplicationPackage app) throws IOException
      Throws:
      IOException
    • asValidIdentifier

      public static String asValidIdentifier(String str)