pub struct Function {
pub constvars: Vec<(Var, HostArray)>,
pub invars: Vec<Var>,
pub eqns: Vec<Eqn>,
pub outvars: Vec<Atom>,
}Expand description
A function of the IR (a closed jaxpr).
Fields§
§constvars: Vec<(Var, HostArray)>Variables bound to constant arrays.
invars: Vec<Var>The inputs.
eqns: Vec<Eqn>The equations, in order of evaluation.
outvars: Vec<Atom>The outputs.
Implementations§
Source§impl Function
impl Function
Sourcepub fn check(&self) -> Result<(), Error>
pub fn check(&self) -> Result<(), Error>
Checks that the function is well formed and well typed: every variable is defined once before it is used, and the outputs of every equation match the abstract evaluation of its primitive (recursively).
§Errors
Returns Error::Malformed describing the first problem.
Trait Implementations§
impl StructuralPartialEq for Function
Auto Trait Implementations§
impl !RefUnwindSafe for Function
impl !UnwindSafe for Function
impl Freeze for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnsafeUnpin for Function
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