Record Class OnnxModelOptions

java.lang.Object
java.lang.Record
com.yahoo.config.model.api.OnnxModelOptions

public record OnnxModelOptions(Optional<String> executionMode, Optional<Integer> interOpThreads, Optional<Integer> intraOpThreads, Optional<OnnxModelOptions.GpuDevice> gpuDevice) extends Record
Onnx model options that are relevant when deciding if an Onnx model needs to be reloaded. If any of the values in this class change, reload is needed.
Author:
hmusum
  • Constructor Details

    • OnnxModelOptions

      public OnnxModelOptions(String executionMode, int interOpThreads, int intraOpThreads, OnnxModelOptions.GpuDevice gpuDevice)
    • OnnxModelOptions

      public OnnxModelOptions(Optional<String> executionMode, Optional<Integer> interOpThreads, Optional<Integer> intraOpThreads, Optional<OnnxModelOptions.GpuDevice> gpuDevice)
      Creates an instance of a OnnxModelOptions record class.
      Parameters:
      executionMode - the value for the executionMode record component
      interOpThreads - the value for the interOpThreads record component
      intraOpThreads - the value for the intraOpThreads record component
      gpuDevice - the value for the gpuDevice record component
  • Method Details

    • empty

      public static OnnxModelOptions empty()
    • withExecutionMode

      public OnnxModelOptions withExecutionMode(String executionMode)
    • withInterOpThreads

      public OnnxModelOptions withInterOpThreads(Integer interOpThreads)
    • withIntraOpThreads

      public OnnxModelOptions withIntraOpThreads(Integer intraOpThreads)
    • withGpuDevice

      public OnnxModelOptions withGpuDevice(OnnxModelOptions.GpuDevice gpuDevice)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • executionMode

      public Optional<String> executionMode()
      Returns the value of the executionMode record component.
      Returns:
      the value of the executionMode record component
    • interOpThreads

      public Optional<Integer> interOpThreads()
      Returns the value of the interOpThreads record component.
      Returns:
      the value of the interOpThreads record component
    • intraOpThreads

      public Optional<Integer> intraOpThreads()
      Returns the value of the intraOpThreads record component.
      Returns:
      the value of the intraOpThreads record component
    • gpuDevice

      public Optional<OnnxModelOptions.GpuDevice> gpuDevice()
      Returns the value of the gpuDevice record component.
      Returns:
      the value of the gpuDevice record component