Trait tensorflow::expr::ExprImpl

source ·
pub trait ExprImpl<T: TensorType>: Display + Debug {
    // Required methods
    fn op_level(&self) -> OpLevel;
    fn children(&self) -> Vec<Box<dyn AnyExpr>>;
    fn create_operation(
        &self,
        graph: &mut Graph,
        children: &[Operation],
        id_gen: &mut dyn FnMut() -> String
    ) -> Result<Operation, Status>;
    fn derivative_by_variable(&self, var: &str) -> Result<Expr<T>, Status>;

    // Provided method
    fn shape_hint(&self) -> ShapeHint<'_> { ... }
}
Expand description

Trait implemented by all expression types. Most users will want to store an Expr instead.

Required Methods§

source

fn op_level(&self) -> OpLevel

Returns the precedence level for this operator.

source

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

Returns the child expressions.

For example, the child expressions of x + y would be x and y.

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.

The implementation must use the operations in the children parameter rather than creating child operations itself.

source

fn derivative_by_variable(&self, var: &str) -> Result<Expr<T>, Status>

Returns the derivative of the expression with respect to the given variable.

Provided Methods§

source

fn shape_hint(&self) -> ShapeHint<'_>

Returns a hint about the expression’s shape.

Implementors§

source§

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

source§

impl<T: TensorType> ExprImpl<T> for Assign<T>

source§

impl<T: TensorType> ExprImpl<T> for Constant<T>

source§

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

source§

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

source§

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

source§

impl<T: TensorType> ExprImpl<T> for Placeholder<T>

source§

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

source§

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

source§

impl<T: TensorType> ExprImpl<T> for TruncateDiv<T>

source§

impl<T: TensorType> ExprImpl<T> for Variable<T>

source§

impl<T: TensorType> ExprImpl<T> for T