pub struct GraphBuilder { /* private fields */ }Implementations§
Source§impl GraphBuilder
impl GraphBuilder
pub fn new(limits: Limits) -> Self
pub fn lookup(&self, name: &str) -> Option<ValueId>
pub fn input(&mut self, name: &str, shape: Vec<usize>) -> Result<ValueId, Error>
pub fn constant( &mut self, name: &str, shape: Vec<usize>, data: Vec<f32>, ) -> Result<ValueId, Error>
Like constant, but shares the buffer, so rebuilding a graph never
copies weights.
pub fn node( &mut self, name: &str, op: Op, inputs: &[ValueId], ) -> Result<ValueId, Error>
pub fn finish(self, outputs: &[ValueId]) -> Result<Graph, Error>
pub fn finish_named( self, outputs: Vec<(String, ValueId)>, ) -> Result<Graph, Error>
Auto Trait Implementations§
impl Freeze for GraphBuilder
impl RefUnwindSafe for GraphBuilder
impl Send for GraphBuilder
impl Sync for GraphBuilder
impl Unpin for GraphBuilder
impl UnsafeUnpin for GraphBuilder
impl UnwindSafe for GraphBuilder
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