pub struct UpsampleLayerParams {
pub scaling_factor: Vec<u64>,
pub fractional_scaling_factor: Vec<f32>,
pub mode: i32,
pub linear_upsample_mode: i32,
}Expand description
A layer that scales up spatial dimensions. It supports two modes: nearest neighbour (default) and bilinear.
.. code::
y = UpsampleLayer(x)Requires 1 input and produces 1 output.
Input
A blob with rank at least 3.
e.g.: blob with shape \[C, H, W\].
For ranks greater than 3, the leading dimensions, starting from 0 to -4 (inclusive), are all treated as batch.
Output
Same rank as the input.
e.g.: blob with shape \[C, scalingFactor[0\] * H, scalingFactor\[1\] * W]
Fields§
§scaling_factor: Vec<u64>Scaling Factor. Mutually exclusive with fractionalScalingFactor.
Must be length 2 in order \[H, W\].
If not set, default value \[1, 1\] is used.
fractional_scaling_factor: Vec<f32>Fractional scaling factor. Mutually exclusive with scalingFactor.
Must be length 2 in order \[H, W\].
If not set, default value \[1.0, 1.0\] is used.
mode: i32§linear_upsample_mode: i32Implementations§
Source§impl UpsampleLayerParams
impl UpsampleLayerParams
Sourcepub fn mode(&self) -> InterpolationMode
pub fn mode(&self) -> InterpolationMode
Returns the enum value of mode, or the default if the field is set to an invalid enum value.
Sourcepub fn set_mode(&mut self, value: InterpolationMode)
pub fn set_mode(&mut self, value: InterpolationMode)
Sets mode to the provided enum value.
Sourcepub fn linear_upsample_mode(&self) -> LinearUpsampleMode
pub fn linear_upsample_mode(&self) -> LinearUpsampleMode
Returns the enum value of linear_upsample_mode, or the default if the field is set to an invalid enum value.
Sourcepub fn set_linear_upsample_mode(&mut self, value: LinearUpsampleMode)
pub fn set_linear_upsample_mode(&mut self, value: LinearUpsampleMode)
Sets linear_upsample_mode to the provided enum value.
Trait Implementations§
Source§impl Clone for UpsampleLayerParams
impl Clone for UpsampleLayerParams
Source§fn clone(&self) -> UpsampleLayerParams
fn clone(&self) -> UpsampleLayerParams
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 UpsampleLayerParams
impl Debug for UpsampleLayerParams
Source§impl Default for UpsampleLayerParams
impl Default for UpsampleLayerParams
Source§impl Message for UpsampleLayerParams
impl Message for UpsampleLayerParams
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for UpsampleLayerParams
impl PartialEq for UpsampleLayerParams
Source§fn eq(&self, other: &UpsampleLayerParams) -> bool
fn eq(&self, other: &UpsampleLayerParams) -> bool
self and other values to be equal, and is used by ==.