#[repr(i32)]pub enum ResizeCoordinateTransformation {
kALIGN_CORNERS = 0,
kASYMMETRIC = 1,
kHALF_PIXEL = 2,
}Expand description
! ! \enum ResizeCoordinateTransformation ! ! \brief The resize coordinate transformation function. ! ! \see IResizeLayer::setCoordinateTransformation() !
Variants§
kALIGN_CORNERS = 0
! Think of each value in the tensor as a unit volume, and the coordinate is a point inside this volume.
! The coordinate point is drawn as a star (*) in the below diagram, and multiple values range has a length.
! Define x_origin as the coordinate of axis x in the input tensor, x_resized as the coordinate of axis x in
! the output tensor, length_origin as length of the input tensor in axis x, and length_resize as length of the
! output tensor in axis x.
!
! |<–––––––length–––––>|
! | 0 | 1 | 2 | 3 |
! * * * *
!
! x_origin = x_resized * (length_origin - 1) / (length_resize - 1)
!
kASYMMETRIC = 1
! |<–––––––length———————>| ! | 0 | 1 | 2 | 3 | ! * * * * ! ! x_origin = x_resized * (length_origin / length_resize) !
kHALF_PIXEL = 2
! |<–––––––length———————>| ! | 0 | 1 | 2 | 3 | ! * * * * ! ! x_origin = (x_resized + 0.5) * (length_origin / length_resize) - 0.5 !
Trait Implementations§
Source§impl Clone for ResizeCoordinateTransformation
impl Clone for ResizeCoordinateTransformation
Source§fn clone(&self) -> ResizeCoordinateTransformation
fn clone(&self) -> ResizeCoordinateTransformation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl From<ResizeCoordinateTransformation> for ResizeCoordinateTransformation
impl From<ResizeCoordinateTransformation> for ResizeCoordinateTransformation
Source§fn from(value: ResizeCoordinateTransformation) -> Self
fn from(value: ResizeCoordinateTransformation) -> Self
Source§impl Into<ResizeCoordinateTransformation> for ResizeCoordinateTransformation
impl Into<ResizeCoordinateTransformation> for ResizeCoordinateTransformation
Source§fn into(self) -> ResizeCoordinateTransformation
fn into(self) -> ResizeCoordinateTransformation
Source§impl Ord for ResizeCoordinateTransformation
impl Ord for ResizeCoordinateTransformation
Source§fn cmp(&self, other: &ResizeCoordinateTransformation) -> Ordering
fn cmp(&self, other: &ResizeCoordinateTransformation) -> 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 ResizeCoordinateTransformation
impl PartialEq for ResizeCoordinateTransformation
Source§fn eq(&self, other: &ResizeCoordinateTransformation) -> bool
fn eq(&self, other: &ResizeCoordinateTransformation) -> bool
self and other values to be equal, and is used by ==.