pub struct GraphBuilder<M: BaseMetadata + Serialize + Clone + Default> { /* private fields */ }
Expand description
Builder for creating a new computation graph.
Implementations§
Source§impl<M: BaseMetadata + Serialize + Clone + Default> GraphBuilder<M>
impl<M: BaseMetadata + Serialize + Clone + Default> GraphBuilder<M>
Sourcepub fn new(ty: EngineType) -> Result<Self, LlamaCoreError>
pub fn new(ty: EngineType) -> Result<Self, LlamaCoreError>
Create a new computation graph builder.
pub fn with_config(self, metadata: M) -> Result<Self, LlamaCoreError>
pub fn use_cpu(self) -> Self
pub fn use_gpu(self) -> Self
pub fn use_tpu(self) -> Self
pub fn build_from_buffer<B>( self, bytes_array: impl AsRef<[B]>, ) -> Result<Graph<M>, LlamaCoreError>
pub fn build_from_files<P>( self, files: impl AsRef<[P]>, ) -> Result<Graph<M>, LlamaCoreError>
pub fn build_from_cache(self) -> Result<Graph<M>, LlamaCoreError>
Trait Implementations§
Auto Trait Implementations§
impl<M> Freeze for GraphBuilder<M>where
M: Freeze,
impl<M> RefUnwindSafe for GraphBuilder<M>where
M: RefUnwindSafe,
impl<M> Send for GraphBuilder<M>where
M: Send,
impl<M> Sync for GraphBuilder<M>where
M: Sync,
impl<M> Unpin for GraphBuilder<M>where
M: Unpin,
impl<M> UnwindSafe for GraphBuilder<M>where
M: UnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more