Trait tensorflow::expr::AnyExpr

source ·
pub trait AnyExpr: Debug {
    // Required methods
    fn key(&self) -> *const ();
    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 clone_box(&self) -> Box<dyn AnyExpr>;
}
Expand description

An AnyExpr is just an Expr<T> for some unknown T. Clients should not implement this.

Required Methods§

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.

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 clone_box(&self) -> Box<dyn AnyExpr>

Returns a boxed clone.

This is used rather than the Clone trait because that would prevent AnyExpr values from being used as trait objects.

Implementors§