Enum acme_tensor::ops::TensorExpr
source · #[non_exhaustive]pub enum TensorExpr<A, B = A> {
Binary(BoxTensor<A>, BoxTensor<B>, BinaryOp),
BinaryScalar(BoxTensor<A>, B, BinaryOp),
Unary(BoxTensor<A>, UnaryOp),
Broadcast(BoxTensor<A>, Shape),
Matmul(BoxTensor<A>, BoxTensor<B>),
Reshape(BoxTensor<A>, Shape),
Shape(ReshapeExpr<A>),
SwapAxes(BoxTensor<A>, Axis, Axis),
Transpose(BoxTensor<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(BoxTensor<A>, BoxTensor<B>, BinaryOp)
BinaryScalar(BoxTensor<A>, B, BinaryOp)
Unary(BoxTensor<A>, UnaryOp)
Broadcast(BoxTensor<A>, Shape)
Matmul(BoxTensor<A>, BoxTensor<B>)
Reshape(BoxTensor<A>, Shape)
Shape(ReshapeExpr<A>)
SwapAxes(BoxTensor<A>, Axis, Axis)
Transpose(BoxTensor<A>)
Implementations§
source§impl<A, B> TensorExpr<A, B>
impl<A, B> TensorExpr<A, B>
pub fn binary(lhs: TensorBase<A>, rhs: TensorBase<B>, op: BinaryOp) -> Self
pub fn binary_scalar(lhs: TensorBase<A>, rhs: B, op: BinaryOp) -> Self
pub fn binary_scalar_c( lhs: TensorBase<A>, rhs: Complex<A>, op: BinaryOp ) -> TensorExpr<A, Complex<A>>
pub fn broadcast(tensor: TensorBase<A>, shape: Shape) -> Self
pub fn matmul(lhs: TensorBase<A>, rhs: TensorBase<B>) -> Self
pub fn reshape(tensor: TensorBase<A>, shape: Shape) -> Self
pub fn shape(expr: ReshapeExpr<A>) -> Self
pub fn swap_axes(tensor: TensorBase<A>, swap: Axis, with: Axis) -> Self
pub fn transpose(scope: TensorBase<A>) -> Self
pub fn unary(tensor: TensorBase<A>, op: UnaryOp) -> Self
pub fn lhs(self) -> Option<TensorBase<A>>
pub fn rhs(self) -> Option<TensorBase<B>>
pub fn view<'a>(&'a self) -> TensorExpr<&'a A, &'a B>
Trait Implementations§
source§impl<A: Clone, B: Clone> Clone for TensorExpr<A, B>
impl<A: Clone, B: Clone> Clone for TensorExpr<A, B>
source§fn clone(&self) -> TensorExpr<A, B>
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<T> From<TensorExpr<T>> for BackpropOp<T>
impl<T> From<TensorExpr<T>> for BackpropOp<T>
source§fn from(op: TensorExpr<T>) -> Self
fn from(op: TensorExpr<T>) -> Self
Converts to this type from the input type.
source§impl<A: PartialEq, B: PartialEq> PartialEq for TensorExpr<A, B>
impl<A: PartialEq, B: PartialEq> PartialEq for TensorExpr<A, B>
source§fn eq(&self, other: &TensorExpr<A, B>) -> bool
fn eq(&self, other: &TensorExpr<A, B>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl<A: Eq, B: Eq> Eq for TensorExpr<A, B>
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>where
B: RefUnwindSafe,
A: RefUnwindSafe,
impl<A, B> Send for TensorExpr<A, B>
impl<A, B> Sync for TensorExpr<A, B>
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> 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