pub struct Swish {
pub beta: f32,
}
Expand description
Vectorized Swish function.
This computes x * sigmoid(beta * x)
for each element.
Fields§
§beta: f32
Trait Implementations§
Source§impl SimdUnaryOp<f32> for Swish
impl SimdUnaryOp<f32> for Swish
Source§fn eval<I: Isa, S: Simd<Elem = f32, Isa = I>>(&self, isa: I, x: S) -> S
fn eval<I: Isa, S: Simd<Elem = f32, Isa = I>>(&self, isa: I, x: S) -> S
Evaluate the unary function on the elements in
x
. Read moreSource§fn map(&self, input: &[T], output: &mut [MaybeUninit<T>])
fn map(&self, input: &[T], output: &mut [MaybeUninit<T>])
Apply this function to a slice. Read more
Source§fn map_mut(&self, input: &mut [T])
fn map_mut(&self, input: &mut [T])
Apply a vectorized unary function to a mutable slice. Read more
Source§fn scalar_eval(&self, x: T) -> T
fn scalar_eval(&self, x: T) -> T
Apply this operation to a single element.
Auto Trait Implementations§
impl Freeze for Swish
impl RefUnwindSafe for Swish
impl Send for Swish
impl Sync for Swish
impl Unpin for Swish
impl UnwindSafe for Swish
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