pub enum UnaryOp {
Show 31 variants
Neg,
Abs,
Sign,
Sqrt,
Rsqrt,
Square,
Cbrt,
Recip,
Exp,
Exp2,
Expm1,
Log,
Log2,
Log10,
Log1p,
Sin,
Cos,
Tan,
Asin,
Acos,
Atan,
Sinh,
Cosh,
Tanh,
Asinh,
Acosh,
Atanh,
Floor,
Ceil,
Round,
Trunc,
}Expand description
Unary operation kind
Variants§
Neg
Negation: -a
Abs
Absolute value: |a|
Sign
Sign: returns -1 for negative, 0 for zero, 1 for positive
Sqrt
Square root: sqrt(a)
Rsqrt
Reciprocal square root: 1/sqrt(a) - critical for normalization layers
Square
Square: a^2
Cbrt
Cube root: cbrt(a)
Recip
Reciprocal: 1/a
Exp
Exponential: e^a
Exp2
Base-2 exponential: 2^a
Expm1
Exponential minus 1: e^a - 1 (numerically stable for small a)
Log
Natural log: ln(a)
Log2
Base-2 logarithm: log2(a)
Log10
Base-10 logarithm: log10(a)
Log1p
Natural log of 1+a: ln(1+a) (numerically stable for small a)
Sin
Sine: sin(a)
Cos
Cosine: cos(a)
Tan
Tangent: tan(a)
Asin
Arc sine (inverse sine): asin(a), domain [-1,1], range [-π/2, π/2]
Acos
Arc cosine (inverse cosine): acos(a), domain [-1,1], range [0, π]
Atan
Arc tangent (inverse tangent): atan(a)
Sinh
Hyperbolic sine: sinh(a)
Cosh
Hyperbolic cosine: cosh(a)
Tanh
Hyperbolic tangent: tanh(a)
Asinh
Inverse hyperbolic sine: asinh(a)
Acosh
Inverse hyperbolic cosine: acosh(a), domain [1, ∞)
Atanh
Inverse hyperbolic tangent: atanh(a), domain (-1, 1)
Floor
Floor: floor(a)
Ceil
Ceiling: ceil(a)
Round
Round to nearest: round(a)
Trunc
Truncate toward zero: trunc(a)
Trait Implementations§
impl Copy for UnaryOp
impl Eq for UnaryOp
impl StructuralPartialEq for UnaryOp
Auto Trait Implementations§
impl Freeze for UnaryOp
impl RefUnwindSafe for UnaryOp
impl Send for UnaryOp
impl Sync for UnaryOp
impl Unpin for UnaryOp
impl UnsafeUnpin for UnaryOp
impl UnwindSafe for UnaryOp
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.