Struct tract_pulse::internal::IntoAst
[−]pub struct IntoAst<'a> {
pub framework: &'a Nnef,
pub parent: Option<&'a IntoAst<'a>>,
pub registries: Vec<String, Global>,
pub prefix: Option<String>,
pub model: &'a Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>,
pub parameters: Vec<String, Global>,
pub results: Vec<String, Global>,
pub mapping: HashMap<OutletId, Arc<RValue>, RandomState>,
pub tensors: Vec<(String, Arc<Tensor>), Global>,
pub quantization: HashMap<String, QuantFormat, RandomState>,
pub fragments: HashMap<String, FragmentDef, RandomState>,
pub body: Vec<Assignment, Global>,
}Fields
framework: &'a Nnefparent: Option<&'a IntoAst<'a>>registries: Vec<String, Global>prefix: Option<String>model: &'a Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>parameters: Vec<String, Global>results: Vec<String, Global>mapping: HashMap<OutletId, Arc<RValue>, RandomState>tensors: Vec<(String, Arc<Tensor>), Global>quantization: HashMap<String, QuantFormat, RandomState>fragments: HashMap<String, FragmentDef, RandomState>body: Vec<Assignment, Global>Implementations
impl<'a> IntoAst<'a>
impl<'a> IntoAst<'a>
pub fn new(
framework: &'a Nnef,
model: &'a Graph<TypedFact, Box<dyn TypedOp + 'static, Global>>
) -> IntoAst<'a>
pub fn into_fragment(
self
) -> Result<(FragmentDef, Vec<RequiredTensorParameter, Global>), Error>
pub fn into_proto_model(self) -> Result<ProtoModel, Error>
pub fn scoped_id(&self, name: impl Into<String>) -> String
pub fn sanitize(name: impl Into<String>) -> String
pub fn force_assign(
&mut self,
name: impl Into<String>,
exp: &Arc<RValue>
) -> Arc<RValue>
pub fn konst(
&mut self,
name: impl Into<String>,
tensor: &Arc<Tensor>
) -> Result<Arc<RValue>, Error>
pub fn konst_variable(
&mut self,
name: impl Into<String>,
tensor: &Arc<Tensor>
) -> Result<Arc<RValue>, Error>
Auto Trait Implementations
impl<'a> !RefUnwindSafe for IntoAst<'a>
impl<'a> Send for IntoAst<'a>
impl<'a> Sync for IntoAst<'a>
impl<'a> Unpin for IntoAst<'a>
impl<'a> !UnwindSafe for IntoAst<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read more