Skip to main content

EagerBackend

Enum EagerBackend 

Source
pub enum EagerBackend {
    Cpu(CpuBackend),
}

Variants§

Trait Implementations§

Source§

impl BackendCachedDot for EagerBackend

Source§

fn dot_general_read_into_accum_cached( &mut self, _cache: &mut Self::RuntimeCache, _cache_slot: Option<usize>, lhs: TensorRead<'_>, rhs: TensorRead<'_>, config: &DotGeneralConfig, accumulation: DotGeneralAccumulation, out: TensorWrite<'_>, ) -> Result<(), Error>

Apply cached scaled dot-general accumulation into caller-provided output. Read more
Source§

impl BackendSessionHost for EagerBackend

Source§

fn with_backend_session<R: Send>( &mut self, f: impl FnOnce(&mut dyn BackendSession) -> R + Send, ) -> R

Source§

impl Debug for EagerBackend

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl TensorAnalytic for EagerBackend

Source§

fn exp(&mut self, input: &Tensor) -> TensorResult<Tensor>

Source§

fn exp_read(&mut self, input: TensorRead<'_>) -> TensorResult<Tensor>

Source§

fn log(&mut self, input: &Tensor) -> TensorResult<Tensor>

Source§

fn log_read(&mut self, input: TensorRead<'_>) -> TensorResult<Tensor>

Source§

fn sin(&mut self, input: &Tensor) -> TensorResult<Tensor>

Source§

fn sin_read(&mut self, input: TensorRead<'_>) -> TensorResult<Tensor>

Source§

fn cos(&mut self, input: &Tensor) -> TensorResult<Tensor>

Source§

fn cos_read(&mut self, input: TensorRead<'_>) -> TensorResult<Tensor>

Source§

fn tanh(&mut self, input: &Tensor) -> TensorResult<Tensor>

Source§

fn tanh_read(&mut self, input: TensorRead<'_>) -> TensorResult<Tensor>

Source§

fn sqrt(&mut self, input: &Tensor) -> TensorResult<Tensor>

Source§

fn sqrt_read(&mut self, input: TensorRead<'_>) -> TensorResult<Tensor>

Source§

fn rsqrt(&mut self, input: &Tensor) -> TensorResult<Tensor>

Source§

fn rsqrt_read(&mut self, input: TensorRead<'_>) -> TensorResult<Tensor>

Source§

fn pow(&mut self, lhs: &Tensor, rhs: &Tensor) -> TensorResult<Tensor>

Source§

fn pow_read( &mut self, lhs: TensorRead<'_>, rhs: TensorRead<'_>, ) -> TensorResult<Tensor>

Source§

fn expm1(&mut self, input: &Tensor) -> TensorResult<Tensor>

Source§

fn expm1_read(&mut self, input: TensorRead<'_>) -> TensorResult<Tensor>

Source§

fn log1p(&mut self, input: &Tensor) -> TensorResult<Tensor>

Source§

fn log1p_read(&mut self, input: TensorRead<'_>) -> TensorResult<Tensor>

Source§

impl TensorBuffer for EagerBackend

Source§

fn reclaim_buffer(&mut self, tensor: Tensor)

Source§

impl TensorDeviceTransfer for EagerBackend

Source§

impl TensorDot for EagerBackend

Source§

fn dot_general( &mut self, lhs: &Tensor, rhs: &Tensor, config: &DotGeneralConfig, ) -> TensorResult<Tensor>

Source§

fn dot_general_read_into( &mut self, lhs: TensorRead<'_>, rhs: TensorRead<'_>, config: &DotGeneralConfig, out: TensorWrite<'_>, ) -> Result<(), Error>

Overwrite caller-provided output with dot-general from read inputs. Read more
Source§

fn dot_general_read_into_accum( &mut self, lhs: TensorRead<'_>, rhs: TensorRead<'_>, config: &DotGeneralConfig, accumulation: DotGeneralAccumulation, out: TensorWrite<'_>, ) -> Result<(), Error>

Apply scaled dot-general accumulation into caller-provided output. Read more
Source§

impl TensorElementwise for EagerBackend

Source§

fn add(&mut self, lhs: &Tensor, rhs: &Tensor) -> TensorResult<Tensor>

Source§

fn add_read( &mut self, lhs: TensorRead<'_>, rhs: TensorRead<'_>, ) -> TensorResult<Tensor>

Elementwise addition accepting either owned tensors or borrowed views. Read more
Source§

fn sub(&mut self, lhs: &Tensor, rhs: &Tensor) -> TensorResult<Tensor>

Source§

fn sub_read( &mut self, lhs: TensorRead<'_>, rhs: TensorRead<'_>, ) -> TensorResult<Tensor>

Elementwise subtraction accepting either owned tensors or borrowed views. Read more
Source§

fn mul(&mut self, lhs: &Tensor, rhs: &Tensor) -> TensorResult<Tensor>

Source§

fn mul_read( &mut self, lhs: TensorRead<'_>, rhs: TensorRead<'_>, ) -> TensorResult<Tensor>

Source§

fn neg(&mut self, input: &Tensor) -> TensorResult<Tensor>

Source§

fn neg_read(&mut self, input: TensorRead<'_>) -> TensorResult<Tensor>

Source§

fn conj(&mut self, input: &Tensor) -> TensorResult<Tensor>

Source§

fn conj_read(&mut self, input: TensorRead<'_>) -> TensorResult<Tensor>

Source§

fn div(&mut self, lhs: &Tensor, rhs: &Tensor) -> TensorResult<Tensor>

Source§

fn div_read( &mut self, lhs: TensorRead<'_>, rhs: TensorRead<'_>, ) -> TensorResult<Tensor>

Source§

fn rem(&mut self, lhs: &Tensor, rhs: &Tensor) -> TensorResult<Tensor>

Elementwise remainder. Read more
Source§

fn rem_read( &mut self, lhs: TensorRead<'_>, rhs: TensorRead<'_>, ) -> TensorResult<Tensor>

Elementwise remainder accepting owned tensors or borrowed views. Read more
Source§

fn abs(&mut self, input: &Tensor) -> TensorResult<Tensor>

Source§

fn abs_read(&mut self, input: TensorRead<'_>) -> TensorResult<Tensor>

Source§

fn sign(&mut self, input: &Tensor) -> TensorResult<Tensor>

Source§

fn sign_read(&mut self, input: TensorRead<'_>) -> TensorResult<Tensor>

Source§

fn maximum(&mut self, lhs: &Tensor, rhs: &Tensor) -> TensorResult<Tensor>

Source§

fn maximum_read( &mut self, lhs: TensorRead<'_>, rhs: TensorRead<'_>, ) -> TensorResult<Tensor>

Source§

fn minimum(&mut self, lhs: &Tensor, rhs: &Tensor) -> TensorResult<Tensor>

Source§

fn minimum_read( &mut self, lhs: TensorRead<'_>, rhs: TensorRead<'_>, ) -> TensorResult<Tensor>

Source§

fn compare( &mut self, lhs: &Tensor, rhs: &Tensor, dir: &CompareDir, ) -> TensorResult<Tensor>

Source§

fn compare_read( &mut self, lhs: TensorRead<'_>, rhs: TensorRead<'_>, dir: &CompareDir, ) -> TensorResult<Tensor>

Source§

fn select( &mut self, pred: &Tensor, on_true: &Tensor, on_false: &Tensor, ) -> TensorResult<Tensor>

Source§

fn select_read( &mut self, pred: TensorRead<'_>, on_true: TensorRead<'_>, on_false: TensorRead<'_>, ) -> TensorResult<Tensor>

Source§

fn clamp( &mut self, input: &Tensor, lower: &Tensor, upper: &Tensor, ) -> TensorResult<Tensor>

Source§

fn clamp_read( &mut self, input: TensorRead<'_>, lower: TensorRead<'_>, upper: TensorRead<'_>, ) -> TensorResult<Tensor>

Source§

fn add_into( &mut self, lhs: &Tensor, rhs: &Tensor, out: TensorWrite<'_>, ) -> Result<(), Error>

Overwrite caller-provided output with elementwise addition. Read more
Source§

fn add_read_into( &mut self, lhs: TensorRead<'_>, rhs: TensorRead<'_>, out: TensorWrite<'_>, ) -> Result<(), Error>

Overwrite caller-provided output with elementwise addition from reads. Read more
Source§

fn sub_into( &mut self, lhs: &Tensor, rhs: &Tensor, out: TensorWrite<'_>, ) -> Result<(), Error>

Overwrite caller-provided output with elementwise subtraction.
Source§

fn sub_read_into( &mut self, lhs: TensorRead<'_>, rhs: TensorRead<'_>, out: TensorWrite<'_>, ) -> Result<(), Error>

Overwrite caller-provided output with elementwise subtraction from reads.
Source§

fn mul_into( &mut self, lhs: &Tensor, rhs: &Tensor, out: TensorWrite<'_>, ) -> Result<(), Error>

Overwrite caller-provided output with elementwise multiplication.
Source§

fn mul_read_into( &mut self, lhs: TensorRead<'_>, rhs: TensorRead<'_>, out: TensorWrite<'_>, ) -> Result<(), Error>

Overwrite caller-provided output with elementwise multiplication from reads.
Source§

fn neg_into( &mut self, input: &Tensor, out: TensorWrite<'_>, ) -> Result<(), Error>

Overwrite caller-provided output with elementwise negation.
Source§

fn neg_read_into( &mut self, input: TensorRead<'_>, out: TensorWrite<'_>, ) -> Result<(), Error>

Overwrite caller-provided output with elementwise negation from a read.
Source§

fn conj_into( &mut self, input: &Tensor, out: TensorWrite<'_>, ) -> Result<(), Error>

Overwrite caller-provided output with elementwise conjugation.
Source§

fn conj_read_into( &mut self, input: TensorRead<'_>, out: TensorWrite<'_>, ) -> Result<(), Error>

Overwrite caller-provided output with elementwise conjugation from a read.
Source§

fn div_into( &mut self, lhs: &Tensor, rhs: &Tensor, out: TensorWrite<'_>, ) -> Result<(), Error>

Overwrite caller-provided output with elementwise division.
Source§

fn div_read_into( &mut self, lhs: TensorRead<'_>, rhs: TensorRead<'_>, out: TensorWrite<'_>, ) -> Result<(), Error>

Overwrite caller-provided output with elementwise division from reads.
Source§

impl TensorIndexing for EagerBackend

Source§

fn gather( &mut self, operand: &Tensor, start_indices: &Tensor, config: &GatherConfig, ) -> TensorResult<Tensor>

Source§

fn scatter( &mut self, operand: &Tensor, scatter_indices: &Tensor, updates: &Tensor, config: &ScatterConfig, ) -> TensorResult<Tensor>

Source§

fn slice( &mut self, input: &Tensor, config: &SliceConfig, ) -> TensorResult<Tensor>

Source§

fn dynamic_slice( &mut self, input: &Tensor, starts: &Tensor, slice_sizes: &[usize], ) -> TensorResult<Tensor>

Source§

fn dynamic_update_slice( &mut self, operand: &Tensor, update: &Tensor, starts: &Tensor, ) -> TensorResult<Tensor>

Source§

fn pad(&mut self, input: &Tensor, config: &PadConfig) -> TensorResult<Tensor>

Source§

fn concatenate( &mut self, inputs: &[&Tensor], axis: usize, ) -> TensorResult<Tensor>

Source§

fn reverse(&mut self, input: &Tensor, axes: &[usize]) -> TensorResult<Tensor>

Source§

impl TensorReduction for EagerBackend

Source§

fn reduce_sum(&mut self, input: &Tensor, axes: &[usize]) -> TensorResult<Tensor>

Source§

fn reduce_prod( &mut self, input: &Tensor, axes: &[usize], ) -> TensorResult<Tensor>

Source§

fn reduce_max(&mut self, input: &Tensor, axes: &[usize]) -> TensorResult<Tensor>

Source§

fn reduce_min(&mut self, input: &Tensor, axes: &[usize]) -> TensorResult<Tensor>

Source§

fn reduce_sum_read( &mut self, input: TensorRead<'_>, axes: &[usize], ) -> Result<Tensor, Error>

Sum elements across axes from an owned tensor or borrowed view. Read more
Source§

fn reduce_prod_read( &mut self, input: TensorRead<'_>, axes: &[usize], ) -> Result<Tensor, Error>

Multiply elements across axes from an owned tensor or borrowed view. Read more
Source§

fn reduce_max_read( &mut self, input: TensorRead<'_>, axes: &[usize], ) -> Result<Tensor, Error>

Take maximum values across axes from an owned tensor or borrowed view. Read more
Source§

fn reduce_min_read( &mut self, input: TensorRead<'_>, axes: &[usize], ) -> Result<Tensor, Error>

Take minimum values across axes from an owned tensor or borrowed view. Read more
Source§

impl TensorStructural for EagerBackend

Source§

fn transpose(&mut self, input: &Tensor, perm: &[usize]) -> TensorResult<Tensor>

Source§

fn reshape(&mut self, input: &Tensor, shape: &[usize]) -> TensorResult<Tensor>

Source§

fn reshape_read( &mut self, input: TensorRead<'_>, shape: &[usize], ) -> TensorResult<Tensor>

Source§

fn broadcast_in_dim( &mut self, input: &Tensor, shape: &[usize], dims: &[usize], ) -> TensorResult<Tensor>

Source§

fn broadcast_in_dim_read( &mut self, input: TensorRead<'_>, shape: &[usize], dims: &[usize], ) -> TensorResult<Tensor>

Source§

fn cast(&mut self, input: &Tensor, to: DType) -> TensorResult<Tensor>

Cast a tensor to another dtype using explicit dtype projection. Read more
Source§

fn extract_diagonal( &mut self, input: &Tensor, axis_a: usize, axis_b: usize, ) -> TensorResult<Tensor>

Source§

fn embed_diagonal( &mut self, input: &Tensor, axis_a: usize, axis_b: usize, ) -> TensorResult<Tensor>

Source§

fn tril(&mut self, input: &Tensor, k: i64) -> TensorResult<Tensor>

Source§

fn triu(&mut self, input: &Tensor, k: i64) -> TensorResult<Tensor>

Source§

fn transpose_read( &mut self, input: TensorRead<'_>, perm: &[usize], ) -> Result<Tensor, Error>

Source§

fn convert(&mut self, input: &Tensor, to: DType) -> Result<Tensor, Error>

Convert a tensor to another dtype using checked dtype conversion. Read more
Source§

impl BackendRuntimeCache for EagerBackend

Source§

impl TensorBackend for EagerBackend

Source§

impl TensorFusion for EagerBackend

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

§

impl<T> DistributionExt for T
where T: ?Sized,

§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> SessionCachedDot for T
where T: TensorBackend + ?Sized,

Source§

fn dot_general_read_into_accum_cached( &mut self, _cache_slot: Option<usize>, lhs: TensorRead<'_>, rhs: TensorRead<'_>, config: &DotGeneralConfig, accumulation: DotGeneralAccumulation, out: TensorWrite<'_>, ) -> Result<(), Error>

Apply session-cached scaled dot-general accumulation into output. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<T> BackendSession for T
where T: TensorBackendOps + SessionCachedDot + ?Sized,

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

§

impl<T> MaybeSend for T
where T: Send,

§

impl<T> MaybeSendSync for T
where T: Send + Sync,

§

impl<T> MaybeSync for T
where T: Sync,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,