ella_common::ops

Trait TensorUnaryOp

Source
pub trait TensorUnaryOp: TensorValue {
    type Output<Out>;

    // Required method
    fn apply<F, O>(self, op: F) -> Self::Output<O>
       where F: Fn(Self::Unmasked) -> O,
             O: TensorValue,
             Self::Output<O>: TensorValue;
}

Required Associated Types§

Source

type Output<Out>

Required Methods§

Source

fn apply<F, O>(self, op: F) -> Self::Output<O>
where F: Fn(Self::Unmasked) -> O, O: TensorValue, Self::Output<O>: TensorValue,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> TensorUnaryOp for Option<T>
where T: TensorValue<Unmasked = T, Masked = Option<T>>,

Source§

type Output<Out> = Option<Out>

Source§

fn apply<F, O>(self, op: F) -> Self::Output<O>
where F: Fn(Self::Unmasked) -> O, O: TensorValue, Self::Output<O>: TensorValue,

Implementors§

Source§

impl<T> TensorUnaryOp for T
where T: TensorValue<Unmasked = T, Masked = Option<T>>,

Source§

type Output<Out> = Out