fix: mark some enums as #[non_exhaustive]

This commit is contained in:
Carson M.
2026-04-16 21:15:29 -05:00
parent 8724e89ff0
commit aac09f11d6
3 changed files with 4 additions and 0 deletions

View File

@@ -494,6 +494,7 @@ impl SessionBuilder {
/// when the offline model is saved. For example, if model has layout optimized for AVX2, the offline model would
/// require CPUs that support AVX2.
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd)]
#[non_exhaustive]
pub enum GraphOptimizationLevel {
/// Disables all graph optimizations.
Disable,
@@ -604,6 +605,7 @@ impl AsPointer for PrepackedWeights {
#[cfg(feature = "api-22")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum AutoDevicePolicy {
/// Same as [`Self::PreferCPU`]; ensures broadest compatibility.
#[default]

View File

@@ -206,6 +206,7 @@ impl Drop for Checkpoint {
}
#[derive(Debug, Clone)]
#[non_exhaustive]
pub enum LearningRateScheduler {
Linear {
warmup_step_count: i64,

View File

@@ -3,6 +3,7 @@ use core::fmt;
/// Enum mapping ONNX Runtime's supported tensor data types.
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[non_exhaustive]
pub enum TensorElementType {
/// 32-bit floating point number, equivalent to Rust's `f32`.
Float32,