#[repr(i32)]pub enum VariableAggregation {
None,
Sum,
Mean,
OnlyFirstReplica,
}Expand description
Indicates how a distributed variable will be aggregated.
Variants§
None
NONE: This is the default, giving an error if you use a
variable-update operation with multiple replicas.
Sum
SUM: Add the updates across replicas.
Mean
MEAN: Take the arithmetic mean (“average”) of the updates across
replicas.
OnlyFirstReplica
ONLY_FIRST_REPLICA: This is for when every replica is performing the same
update, but we only want to perform the update once. Used, e.g., for the
global step counter.
Implementations§
source§impl VariableAggregation
impl VariableAggregation
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.
Trait Implementations§
source§impl Clone for VariableAggregation
impl Clone for VariableAggregation
source§fn clone(&self) -> VariableAggregation
fn clone(&self) -> VariableAggregation
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for VariableAggregation
impl Debug for VariableAggregation
source§impl Default for VariableAggregation
impl Default for VariableAggregation
source§fn default() -> VariableAggregation
fn default() -> VariableAggregation
Returns the “default value” for a type. Read more
source§impl From<VariableAggregation> for i32
impl From<VariableAggregation> for i32
source§fn from(value: VariableAggregation) -> i32
fn from(value: VariableAggregation) -> i32
Converts to this type from the input type.
source§impl Hash for VariableAggregation
impl Hash for VariableAggregation
source§impl Ord for VariableAggregation
impl Ord for VariableAggregation
source§fn cmp(&self, other: &VariableAggregation) -> Ordering
fn cmp(&self, other: &VariableAggregation) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<VariableAggregation> for VariableAggregation
impl PartialEq<VariableAggregation> for VariableAggregation
source§fn eq(&self, other: &VariableAggregation) -> bool
fn eq(&self, other: &VariableAggregation) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd<VariableAggregation> for VariableAggregation
impl PartialOrd<VariableAggregation> for VariableAggregation
source§fn partial_cmp(&self, other: &VariableAggregation) -> Option<Ordering>
fn partial_cmp(&self, other: &VariableAggregation) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Copy for VariableAggregation
impl Eq for VariableAggregation
impl StructuralEq for VariableAggregation
impl StructuralPartialEq for VariableAggregation
Auto Trait Implementations§
impl RefUnwindSafe for VariableAggregation
impl Send for VariableAggregation
impl Sync for VariableAggregation
impl Unpin for VariableAggregation
impl UnwindSafe for VariableAggregation
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
§impl<T> ClampCast for Twhere
T: PartialOrd<T> + Copy + 'static,
impl<T> ClampCast for Twhere T: PartialOrd<T> + Copy + 'static,
fn clamp_cast<O>(self) -> Owhere Self: AsPrimitive<O> + Datum, O: AsPrimitive<Self> + Bounded + Datum,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.