#[repr(i32)]pub enum ReduceOperation {
kSUM = 0,
kPROD = 1,
kMAX = 2,
kMIN = 3,
kAVG = 4,
kNONE = 5,
}Expand description
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
The table shows the result of reducing across an empty volume of a given type.
| Operation | kFLOAT and kHALF | kINT32 | kINT8 |
|---|---|---|---|
| kSUM | 0 | 0 | 0 |
| kPROD | 1 | 1 | 1 |
| kMAX | negative infinity | INT_MIN | -128 |
| kMIN | positive infinity | INT_MAX | 127 |
| kAVG | NaN | 0 | -128 |
| kNONE | Undefined | Undefined | Undefined |
The current version of TensorRT usually performs reduction for kINT8 via kFLOAT or kHALF. The kINT8 values show the quantized representations of the floating-point values. kNONE is a reduce operation which does not modify the input tensor. This is applicable to Multi-Device mode only, as a reduce operation is not mandatory for certain collective operations. See INetworkDefinition::addDistCollective for more details.
Variants§
kSUM = 0
< Sum of the elements.
kPROD = 1
< Product of the elements.
kMAX = 2
< Maximum of the elements.
kMIN = 3
< Minimum of the elements.
kAVG = 4
< Average of the elements.
kNONE = 5
< No reduction.
Trait Implementations§
Source§impl Clone for ReduceOperation
impl Clone for ReduceOperation
Source§fn clone(&self) -> ReduceOperation
fn clone(&self) -> ReduceOperation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ExternType for ReduceOperation
impl ExternType for ReduceOperation
Source§impl From<ReduceOperation> for ReduceOperation
impl From<ReduceOperation> for ReduceOperation
Source§fn from(value: ReduceOperation) -> Self
fn from(value: ReduceOperation) -> Self
Converts to this type from the input type.
Source§impl Hash for ReduceOperation
impl Hash for ReduceOperation
Source§impl Into<ReduceOperation> for ReduceOperation
impl Into<ReduceOperation> for ReduceOperation
Source§fn into(self) -> ReduceOperation
fn into(self) -> ReduceOperation
Converts this type into the (usually inferred) input type.
Source§impl PartialEq for ReduceOperation
impl PartialEq for ReduceOperation
Source§fn eq(&self, other: &ReduceOperation) -> bool
fn eq(&self, other: &ReduceOperation) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ReduceOperation
impl StructuralPartialEq for ReduceOperation
impl UniquePtrTarget for ReduceOperation
impl VectorElement for ReduceOperation
impl WeakPtrTarget for ReduceOperation
Auto Trait Implementations§
impl Freeze for ReduceOperation
impl RefUnwindSafe for ReduceOperation
impl Send for ReduceOperation
impl Sync for ReduceOperation
impl Unpin for ReduceOperation
impl UnsafeUnpin for ReduceOperation
impl UnwindSafe for ReduceOperation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more