#[repr(i32)]pub enum ResizeCoordinateTransformation {
kALIGN_CORNERS = 0,
kASYMMETRIC = 1,
kHALF_PIXEL = 2,
}Expand description
ResizeCoordinateTransformation
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 moreimpl Eq for ResizeCoordinateTransformation
Source§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 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 ==.