pub struct ScaleLayerParams {
pub shape_scale: Vec<u64>,
pub scale: Option<WeightParams>,
pub has_bias: bool,
pub shape_bias: Vec<u64>,
pub bias: Option<WeightParams>,
}Expand description
A layer that performs elmentwise multiplication by a scale factor and optionally adds a bias; both the scale and bias are broadcasted to match the input shape.
.. code::
y = ScaleLayer(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
A blob with the same shape as the input.
Fields§
§shape_scale: Vec<u64>The shape of the scale.
Must be one of the following:
\[1\], \[C\], \[1, H, W\] or \[C, H, W\].
scale: Option<WeightParams>The scale values.
The size must be equal to the product of the shape dimensions.
Scale values. Size must be equal to the product of dimensions specified in shapeScale.
has_bias: boolIf true, a bias is added after scaling.
shape_bias: Vec<u64>The shape of the bias.
Must be one of the following:
\[1\], \[C\], \[1, H, W\] or \[C, H, W\].
bias: Option<WeightParams>The bias values.
The size must be equal to the product of the shape dimensions.
Trait Implementations§
Source§impl Clone for ScaleLayerParams
impl Clone for ScaleLayerParams
Source§fn clone(&self) -> ScaleLayerParams
fn clone(&self) -> ScaleLayerParams
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 ScaleLayerParams
impl Debug for ScaleLayerParams
Source§impl Default for ScaleLayerParams
impl Default for ScaleLayerParams
Source§impl Message for ScaleLayerParams
impl Message for ScaleLayerParams
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 ScaleLayerParams
impl PartialEq for ScaleLayerParams
Source§fn eq(&self, other: &ScaleLayerParams) -> bool
fn eq(&self, other: &ScaleLayerParams) -> bool
self and other values to be equal, and is used by ==.