pub struct ReduceLayerParams {
pub mode: i32,
pub epsilon: f32,
pub axis: i32,
}Expand description
A layer that reduces the input using a specified operation.
.. code::
y = ReduceLayer(x)Requires 1 input and produces 1 output.
Input A blob that can, in general, have any rank. However, depending on the value of “axis” , there may be additional rank constraints. Output A blob with the same rank as the input, which has 1s on the dimensions specified in the parameter “axis”
Values supported for axis are \[-1\], \[-2\], \[-3\], \[-2,-1\], \[-3,-2,-1\]
and the equivalent positive values (depending on the rank of the input)
For mode == 'ArgMax', axis must be \[-1\] or \[-2\] or \[-3\].Fields§
§mode: i32Specifies function used to reduce.
epsilon: f32Used if mode is LOGSUM.
Defaults to 1e-6 if not set or is set to 0.
axis: i32The following mapping is used for interpreting this parameter: CHW = axis [-3, -2, -1], input must have rank at least 3. HW = axis [-2, -1], input must have rank at least 2. C = axis [-3] H = axis [-2] W = axis [-1]
Implementations§
Source§impl ReduceLayerParams
impl ReduceLayerParams
Sourcepub fn mode(&self) -> ReduceOperation
pub fn mode(&self) -> ReduceOperation
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: ReduceOperation)
pub fn set_mode(&mut self, value: ReduceOperation)
Sets mode to the provided enum value.
Sourcepub fn axis(&self) -> ReduceAxis
pub fn axis(&self) -> ReduceAxis
Returns the enum value of axis, or the default if the field is set to an invalid enum value.
Sourcepub fn set_axis(&mut self, value: ReduceAxis)
pub fn set_axis(&mut self, value: ReduceAxis)
Sets axis to the provided enum value.
Trait Implementations§
Source§impl Clone for ReduceLayerParams
impl Clone for ReduceLayerParams
Source§fn clone(&self) -> ReduceLayerParams
fn clone(&self) -> ReduceLayerParams
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 ReduceLayerParams
impl Debug for ReduceLayerParams
Source§impl Default for ReduceLayerParams
impl Default for ReduceLayerParams
Source§impl Message for ReduceLayerParams
impl Message for ReduceLayerParams
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 ReduceLayerParams
impl PartialEq for ReduceLayerParams
Source§fn eq(&self, other: &ReduceLayerParams) -> bool
fn eq(&self, other: &ReduceLayerParams) -> bool
self and other values to be equal, and is used by ==.