INNER CODE UNIT · Rust
execute
rustformers/llm · crates/ggml/src/lib.rs:370
pub fn execute(&mut self, context: &Context) {
let mut work_buffer = self.create_work_buffer(context);
self.assign_work_buffer(&mut work_buffer);
unsafe {
sys::ggml_graph_compute(self.inner_graph, &mut self.inner);
}
}
}
/// The size of `t` as bytes.
pub fn type_size(t: Type) -> usize {
unsafe { sys::ggml_type_size(t.into()) }
}
/// [type_size]/[blck_size] as float.
pub fn type_sizef(x: Type) -> f64 {
(unsafe { sys::ggml_type_sizef(x.into()) }) as f64