Skip to content

armgit / uzu

Public Imported from GitHub
0

A high-performance inference engine for AI models

Reduce Memory (#216)

eugene46f237a9340c
diff --git a/crates/uzu/src/forward_pass/scratch_buffers.rs b/crates/uzu/src/forward_pass/scratch_buffers.rs
index 6789482f1..a616571aa 100644
--- a/crates/uzu/src/forward_pass/scratch_buffers.rs
+++ b/crates/uzu/src/forward_pass/scratch_buffers.rs
@@ -80,7 +80,7 @@ impl<B: Backend> ScratchBuffers<B> {
) -> Self {
// Helper closure for allocation
let alloc = |shape: &[usize], dtype: DataType, label: &str| -> ArrayCell<B> {
- let array = context.create_array(shape, dtype, &format!("scratch_buffers_{label}"));
+ let array = context.create_array_uninitialized(shape, dtype, &format!("scratch_buffers_{label}"));
RefCell::new(array)
};