#[repr(i32)]pub enum LinearUpsampleMode {
Default = 0,
AlignCornersTrue = 1,
AlignCornersFalse = 2,
}Expand description
LinearUpsampleMode specifies the behavior for linear upsampling. Only valid when Interpolation Mode is BILINEAR. If input grid is [0, Xin-1] (corresponding to an input size of Xin), and if the output size is Xout, then the grid points are sampled in the following manner: DEFAULT: spacing = (Xin-Xin/Xout) / (Xout-1) grid_point[i] = min(Xin-1, max(0, i * spacing)), for i = 0,1,2,….,Xout-1 ALIGN_CORNERS_TRUE: spacing = (Xin-1) / (Xout-1) grid_point[i] = min(Xin-1, max(0, i * spacing)), for i = 0,1,2,….,Xout-1 ALIGN_CORNERS_FALSE: spacing = Xin / Xout grid_point[i] = min(Xin-1, max(0, i * spacing + 0.5 * spacing - 0.5)), for i = 0,1,2,….,Xout-1
Variants§
Implementations§
Source§impl LinearUpsampleMode
impl LinearUpsampleMode
Sourcepub fn from_i32(value: i32) -> Option<LinearUpsampleMode>
👎Deprecated: Use the TryFrom<i32> implementation instead
pub fn from_i32(value: i32) -> Option<LinearUpsampleMode>
Use the TryFrom<i32> implementation instead
Converts an i32 to a LinearUpsampleMode, or None if value is not a valid variant.
Source§impl LinearUpsampleMode
impl LinearUpsampleMode
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Clone for LinearUpsampleMode
impl Clone for LinearUpsampleMode
Source§fn clone(&self) -> LinearUpsampleMode
fn clone(&self) -> LinearUpsampleMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LinearUpsampleMode
impl Debug for LinearUpsampleMode
Source§impl Default for LinearUpsampleMode
impl Default for LinearUpsampleMode
Source§fn default() -> LinearUpsampleMode
fn default() -> LinearUpsampleMode
Source§impl From<LinearUpsampleMode> for i32
impl From<LinearUpsampleMode> for i32
Source§fn from(value: LinearUpsampleMode) -> i32
fn from(value: LinearUpsampleMode) -> i32
Source§impl Hash for LinearUpsampleMode
impl Hash for LinearUpsampleMode
Source§impl Ord for LinearUpsampleMode
impl Ord for LinearUpsampleMode
Source§fn cmp(&self, other: &LinearUpsampleMode) -> Ordering
fn cmp(&self, other: &LinearUpsampleMode) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for LinearUpsampleMode
impl PartialEq for LinearUpsampleMode
Source§fn eq(&self, other: &LinearUpsampleMode) -> bool
fn eq(&self, other: &LinearUpsampleMode) -> bool
self and other values to be equal, and is used by ==.