Class OnnxModelMetadata

java.lang.Object
ai.onnxruntime.OnnxModelMetadata

public final class OnnxModelMetadata extends Object
Contains the metadata associated with an ONNX model.

Unspecified default fields contain the empty string.

This class is a Java side copy of the native metadata, it does not access the native runtime.

  • Constructor Details

    • OnnxModelMetadata

      public OnnxModelMetadata(OnnxModelMetadata other)
      Copy constructor.
      Parameters:
      other - The metadata to copy.
  • Method Details

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getProducerName

      public String getProducerName()
      Gets the producer name.
      Returns:
      The producer name.
    • getGraphName

      public String getGraphName()
      Gets the graph name.
      Returns:
      The graph name.
    • getGraphDescription

      public String getGraphDescription()
      Gets the graph description.
      Returns:
      The graph description.
    • getDomain

      public String getDomain()
      Gets the domain.
      Returns:
      The domain.
    • getDescription

      public String getDescription()
      Gets the model description.
      Returns:
      The description.
    • getVersion

      public long getVersion()
      Gets the model version.
      Returns:
      The model version.
    • getCustomMetadata

      public Map<String,String> getCustomMetadata()
      Gets an unmodifiable reference to the complete custom metadata.
      Returns:
      The custom metadata.
    • getCustomMetadataValue

      public Optional<String> getCustomMetadataValue(String key)
      Returns Optional.of(value) if the custom metadata has a value for the supplied key, otherwise returns Optional.empty().
      Parameters:
      key - The custom metadata key.
      Returns:
      The custom metadata value if present.
    • toString

      public String toString()
      Overrides:
      toString in class Object