Struct tensorflow::expr::Expr

source ·
pub struct Expr<T: TensorType> { /* private fields */ }
Expand description

A operation in an expression tree, which is a thin wrapper around an ExprImpl.

This is separate from ExprImpl because we want expressions to be wrapped in an Rc, and we can’t directly implement std::ops::Add, etc., for Rc<E: ExprImpl<Tgt;>.

Implementations§

source§

impl<T: TensorType> Expr<T>

source

pub fn new<I>(expr: I) -> Expr<T>where I: ExprImpl<T> + 'static,

Wraps an ExprImpl.

Trait Implementations§

source§

impl<T: TensorType> Add<Expr<T>> for Expr<T>

§

type Output = Expr<T>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Expr<T>) -> Expr<T>

Performs the + operation. Read more
source§

impl<T: TensorType> Add<T> for Expr<T>

§

type Output = Expr<T>

The resulting type after applying the + operator.
source§

fn add(self, rhs: T) -> Expr<T>

Performs the + operation. Read more
source§

impl<T: TensorType> AnyExpr for Expr<T>

source§

fn key(&self) -> *const ()

Returns a pointer usable as a map key which identifies this expression.
source§

fn children(&self) -> Vec<Box<dyn AnyExpr>>

Returns the child expressions. Read more
source§

fn create_operation( &self, graph: &mut Graph, children: &[Operation], id_gen: &mut dyn FnMut() -> String ) -> Result<Operation, Status>

Creates an operation for the expression. Read more
source§

fn clone_box(&self) -> Box<dyn AnyExpr>

Returns a boxed clone. Read more
source§

impl<T: Clone + TensorType> Clone for Expr<T>

source§

fn clone(&self) -> Expr<T>

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<T: Debug + TensorType> Debug for Expr<T>

source§

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

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

impl<T: TensorType> Deref for Expr<T>

§

type Target = dyn ExprImpl<T> + 'static

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<T: TensorType> Display for Expr<T>

source§

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

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

impl<T: TensorType> Div<Expr<T>> for Expr<T>

§

type Output = Expr<T>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Expr<T>) -> Expr<T>

Performs the / operation. Read more
source§

impl<T: TensorType> Div<T> for Expr<T>

§

type Output = Expr<T>

The resulting type after applying the / operator.
source§

fn div(self, rhs: T) -> Expr<T>

Performs the / operation. Read more
source§

impl<T: TensorType> From<T> for Expr<T>

source§

fn from(value: T) -> Self

Converts to this type from the input type.
source§

impl<T: TensorType> Mul<Expr<T>> for Expr<T>

§

type Output = Expr<T>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Expr<T>) -> Expr<T>

Performs the * operation. Read more
source§

impl<T: TensorType> Mul<T> for Expr<T>

§

type Output = Expr<T>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: T) -> Expr<T>

Performs the * operation. Read more
source§

impl<T: TensorType> Neg for Expr<T>

§

type Output = Expr<T>

The resulting type after applying the - operator.
source§

fn neg(self) -> Expr<T>

Performs the unary - operation. Read more
source§

impl<T: TensorType> Rem<Expr<T>> for Expr<T>

§

type Output = Expr<T>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: Expr<T>) -> Expr<T>

Performs the % operation. Read more
source§

impl<T: TensorType> Rem<T> for Expr<T>

§

type Output = Expr<T>

The resulting type after applying the % operator.
source§

fn rem(self, rhs: T) -> Expr<T>

Performs the % operation. Read more
source§

impl<T: TensorType> Sub<Expr<T>> for Expr<T>

§

type Output = Expr<T>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Expr<T>) -> Expr<T>

Performs the - operation. Read more
source§

impl<T: TensorType> Sub<T> for Expr<T>

§

type Output = Expr<T>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: T) -> Expr<T>

Performs the - operation. Read more

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for Expr<T>

§

impl<T> !Send for Expr<T>

§

impl<T> !Sync for Expr<T>

§

impl<T> Unpin for Expr<T>

§

impl<T> !UnwindSafe for Expr<T>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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, Rhs, Output> NumOps<Rhs, Output> for Twhere T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,