Enum Class GraphOptimizationLevel

java.lang.Object
java.lang.Enum<GraphOptimizationLevel>
smile.onnx.GraphOptimizationLevel
All Implemented Interfaces:
Serializable, Comparable<GraphOptimizationLevel>, Constable

public enum GraphOptimizationLevel extends Enum<GraphOptimizationLevel>
Graph optimization level for an ONNX Runtime session, corresponding to GraphOptimizationLevel in the ONNX Runtime C API.

Higher optimization levels may increase session initialization time but typically reduce inference latency.

  • Enum Constant Details

    • DISABLE_ALL

      public static final GraphOptimizationLevel DISABLE_ALL
      Disable all optimizations.
    • ENABLE_BASIC

      public static final GraphOptimizationLevel ENABLE_BASIC
      Enable basic optimizations (redundant node eliminations).
    • ENABLE_EXTENDED

      public static final GraphOptimizationLevel ENABLE_EXTENDED
      Enable extended optimizations (complex node fusions).
    • ENABLE_LAYOUT

      public static final GraphOptimizationLevel ENABLE_LAYOUT
      Enable layout optimizations.
    • ENABLE_ALL

      public static final GraphOptimizationLevel ENABLE_ALL
      Enable all available optimizations.
  • Method Details

    • values

      public static GraphOptimizationLevel[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static GraphOptimizationLevel valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • value

      public int value()
      Returns the ORT integer code.
      Returns:
      the ORT integer code.