INNER CODE UNIT · Rust
from_raw
rustformers/llm · crates/ggml/src/lib.rs:328
pub fn from_raw(raw_context: *mut sys::ggml_cgraph) -> Self {
Self { inner: raw_context }
}
/// Build this computational graph in the forward direction in preparation for computation.
pub fn build_forward_expand(&mut self, tensor: &Tensor) {
unsafe { sys::ggml_build_forward_expand(self.inner, tensor.ptr.as_ptr()) }
}
}
/// A `ggml` execution plan. Contains the information needed to execute a computation graph.
pub struct GraphExecutionPlan {
inner: sys::ggml_cplan,
inner_graph: *mut sys::ggml_cgraph,
}
impl GraphExecutionPlan {
/// Create a new [GraphExecutionPlan] from a [ComputationGraph] and the number of threads to use.