INNER CODE UNIT · Rust

create_work_buffer

rustformers/llm · crates/ggml/src/lib.rs:354

    fn create_work_buffer(&mut self, context: &Context) -> Tensor {
        context.new_tensor_1d(Type::I8, self.inner.work_size)
    }

    /// Assign a work buffer to this [GraphExecutionPlan].
    fn assign_work_buffer(&mut self, buffer: &mut Tensor) {
        assert!(
            buffer.get_type() == Type::I8,
            "Work buffer must be of type i8"
        );
        unsafe {
            self.inner.work_data = buffer.data().cast();
        }
    }

    /// Execute this [GraphExecutionPlan] in the given [Context].
    pub fn execute(&mut self, context: &Context) {
        let mut work_buffer = self.create_work_buffer(context);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…