INNER CODE UNIT · Rust
build_forward_expand
rustformers/llm · crates/ggml/src/lib.rs:333
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.
pub fn new(graph: &mut ComputationGraph, n_threads: usize) -> Self {
Self {
inner: unsafe { sys::ggml_graph_plan(graph.inner, usize_to_i32(n_threads)) },
inner_graph: graph.inner,
}