Enum TensorExpr

Source
#[non_exhaustive]
pub enum TensorExpr<A, B = A> { Binary(Box<TensorBase<A>>, Box<TensorBase<B>>, BinaryOp), BinaryScalar(Box<TensorBase<A>>, B, BinaryOp), Unary(Box<TensorBase<A>>, UnaryOp), Matmul(Box<TensorBase<A>>, Box<TensorBase<B>>), Sigmoid(Box<TensorBase<A>>), Shape(ReshapeExpr<A>), }

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Binary(Box<TensorBase<A>>, Box<TensorBase<B>>, BinaryOp)

§

BinaryScalar(Box<TensorBase<A>>, B, BinaryOp)

§

Unary(Box<TensorBase<A>>, UnaryOp)

§

Matmul(Box<TensorBase<A>>, Box<TensorBase<B>>)

§

Sigmoid(Box<TensorBase<A>>)

§

Shape(ReshapeExpr<A>)

Implementations§

Source§

impl<A, B> TensorExpr<A, B>

Source

pub fn binary( lhs: TensorBase<A>, rhs: TensorBase<B>, op: BinaryOp, ) -> TensorExpr<A, B>

Source

pub fn binary_scalar( lhs: TensorBase<A>, rhs: B, op: BinaryOp, ) -> TensorExpr<A, B>

Source

pub fn binary_scalar_c( lhs: TensorBase<A>, rhs: Complex<A>, op: BinaryOp, ) -> TensorExpr<A, Complex<A>>

Source

pub fn broadcast(tensor: TensorBase<A>, shape: Shape) -> TensorExpr<A, B>

Source

pub fn matmul(lhs: TensorBase<A>, rhs: TensorBase<B>) -> TensorExpr<A, B>

Source

pub fn reshape(tensor: TensorBase<A>, shape: Shape) -> TensorExpr<A, B>

Source

pub fn shape(expr: ReshapeExpr<A>) -> TensorExpr<A, B>

Source

pub fn sigmoid(tensor: TensorBase<A>) -> TensorExpr<A, B>

Source

pub fn swap_axes( tensor: TensorBase<A>, swap: Axis, with: Axis, ) -> TensorExpr<A, B>

Source

pub fn transpose(tensor: TensorBase<A>) -> TensorExpr<A, B>

Source

pub fn unary(tensor: TensorBase<A>, op: UnaryOp) -> TensorExpr<A, B>

Source

pub fn lhs(self) -> Option<TensorBase<A>>

Source

pub fn rhs(self) -> Option<TensorBase<B>>

Source

pub fn view(&self) -> TensorExpr<&A, &B>

Source

pub fn view_mut(&mut self) -> TensorExpr<&mut A, &mut B>

Trait Implementations§

Source§

impl<A, B> Clone for TensorExpr<A, B>
where A: Clone, B: Clone,

Source§

fn clone(&self) -> TensorExpr<A, B>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<A, B> Debug for TensorExpr<A, B>
where A: Debug, B: Debug,

Source§

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

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

impl<'de, A, B> Deserialize<'de> for TensorExpr<A, B>
where A: Deserialize<'de>, B: Deserialize<'de>,

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<TensorExpr<A, B>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<A, B> From<ReshapeExpr<A>> for TensorExpr<A, B>

Source§

fn from(expr: ReshapeExpr<A>) -> TensorExpr<A, B>

Converts to this type from the input type.
Source§

impl<T> From<TensorExpr<T>> for BackpropOp<T>

Source§

fn from(op: TensorExpr<T>) -> BackpropOp<T>

Converts to this type from the input type.
Source§

impl<A, B> Hash for TensorExpr<A, B>
where A: Hash, B: Hash,

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<A, B> PartialEq for TensorExpr<A, B>
where A: PartialEq, B: PartialEq,

Source§

fn eq(&self, other: &TensorExpr<A, B>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<A, B> Serialize for TensorExpr<A, B>
where A: Serialize, B: Serialize,

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<A, B> Eq for TensorExpr<A, B>
where A: Eq, B: Eq,

Source§

impl<A, B> StructuralPartialEq for TensorExpr<A, B>

Auto Trait Implementations§

§

impl<A, B> Freeze for TensorExpr<A, B>
where B: Freeze,

§

impl<A, B> RefUnwindSafe for TensorExpr<A, B>

§

impl<A, B> Send for TensorExpr<A, B>
where B: Send, A: Send,

§

impl<A, B> Sync for TensorExpr<A, B>
where B: Sync, A: Sync,

§

impl<A, B> Unpin for TensorExpr<A, B>
where B: Unpin,

§

impl<A, B> UnwindSafe for TensorExpr<A, B>
where B: UnwindSafe, A: UnwindSafe,

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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<S, F> IntoOp<F> for S
where F: Operator, S: Into<F>,

Source§

fn into_op(self) -> F

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,