#[repr(i32)]pub enum ReduceOperation {
Sum = 0,
Avg = 1,
Prod = 2,
Logsum = 3,
Sumsquare = 4,
L1 = 5,
L2 = 6,
Max = 7,
Min = 8,
Argmax = 9,
}Expand description
The following reduction operations are supported and are applied on the specified axis of the input array:
SUM
Sum of all elements
.. math:: \sum{x_i}AVG
Sum of all elements divided by the number of elements
.. math:: \dfrac{\sum^n{x_i}}{n}PROD
Product of all elements
.. math:: \prod{x_i}LOGSUM
Sum of the natural logarithm of all elements
.. math:: \sum{\ln{(x_i + \epsilon)}}SUMSQUARE
Sum of squares of all elements
.. math:: \sum{x^2}L1
L1 normalization of all elements
.. math:: ||x||_1 = \sum{|x_i|}L2
L2 normalization of all elements
.. math:: ||x||_2 = \sqrt{\sum{x_i^2}}MAX
Maximum of all elements
.. math:: \text{max}(x_i)MIN
Minimum of all elements
.. math:: \text{min}(x_i)ARGMAX
Argument of the maximum of all elements
.. math:: \text{argmax}(x_i)Variants§
Sum = 0
Avg = 1
Prod = 2
Logsum = 3
Sumsquare = 4
L1 = 5
L2 = 6
Max = 7
Min = 8
Argmax = 9
only supported with axis = C, H or W.
Implementations§
Source§impl ReduceOperation
impl ReduceOperation
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Clone for ReduceOperation
impl Clone for ReduceOperation
Source§fn clone(&self) -> ReduceOperation
fn clone(&self) -> ReduceOperation
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 ReduceOperation
impl Debug for ReduceOperation
Source§impl Default for ReduceOperation
impl Default for ReduceOperation
Source§fn default() -> ReduceOperation
fn default() -> ReduceOperation
Source§impl From<ReduceOperation> for i32
impl From<ReduceOperation> for i32
Source§fn from(value: ReduceOperation) -> i32
fn from(value: ReduceOperation) -> i32
Source§impl Hash for ReduceOperation
impl Hash for ReduceOperation
Source§impl Ord for ReduceOperation
impl Ord for ReduceOperation
Source§fn cmp(&self, other: &ReduceOperation) -> Ordering
fn cmp(&self, other: &ReduceOperation) -> 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 ReduceOperation
impl PartialEq for ReduceOperation
Source§fn eq(&self, other: &ReduceOperation) -> bool
fn eq(&self, other: &ReduceOperation) -> bool
self and other values to be equal, and is used by ==.