Skip to main content

objc2_core_ml/generated/
MLReshapeFrequencyHint.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use objc2::__framework_prelude::*;
4
5use crate::*;
6
7/// The anticipated frequency of changing input shapes
8///
9/// See also [Apple's documentation](https://developer.apple.com/documentation/coreml/mlreshapefrequencyhint?language=objc)
10// NS_ENUM
11#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct MLReshapeFrequencyHint(pub NSInteger);
14impl MLReshapeFrequencyHint {
15    /// The input shape is expected to change frequently on each prediction sent to this loaded model instance. Core ML will try to minimize the latency associated with shape changes and avoid expensive shape-specific optimizations prior to prediction computation. While prediction computation may be slower for each specific shape, switching between shapes should be faster.
16    /// This is the default.
17    #[doc(alias = "MLReshapeFrequencyHintFrequent")]
18    pub const Frequent: Self = Self(0);
19    /// The input shape is expected to be stable and many/all predictions sent to this loaded model instance would use the same input shapes repeatedly. On the shape change, Core ML re-optimizes the internal engine for the new shape if possible. The re-optimization takes some time, but the subsequent predictions for the shape should run faster.
20    #[doc(alias = "MLReshapeFrequencyHintInfrequent")]
21    pub const Infrequent: Self = Self(1);
22}
23
24unsafe impl Encode for MLReshapeFrequencyHint {
25    const ENCODING: Encoding = NSInteger::ENCODING;
26}
27
28unsafe impl RefEncode for MLReshapeFrequencyHint {
29    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}