pub struct GContextBuilder { /* private fields */ }
Expand description
GGML context builder structure used to build a GContext.
Implementations§
Source§impl GContextBuilder
impl GContextBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new GContextBuilder.
Sourcepub fn no_alloc(self, no_alloc: bool) -> Self
pub fn no_alloc(self, no_alloc: bool) -> Self
When a context is in no_alloc mode, apparently this means that data for tensors is not allocated at all so all requests will succeed (althoug the context needs to have at least enough memory for the GGML objects).
Naturally, you can’t actually execute the graph when this is turned on, so the main use is to probe how much memory building a graph will require and then use that value to create another context with the expected memory size and then populate that with the actual tensor data.
Trait Implementations§
Source§impl Default for GContextBuilder
impl Default for GContextBuilder
Source§fn default() -> GContextBuilder
fn default() -> GContextBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GContextBuilder
impl RefUnwindSafe for GContextBuilder
impl Send for GContextBuilder
impl Sync for GContextBuilder
impl Unpin for GContextBuilder
impl UnwindSafe for GContextBuilder
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