This repository was archived by the owner on Jun 24, 2024. It is now read-only.
Commit 32925e7 1 parent eab7235 commit 32925e7 Copy full SHA for 32925e7
File tree 2 files changed +12
-13
lines changed
2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -361,17 +361,17 @@ impl Tensor {
361
361
} )
362
362
}
363
363
364
- /// Set the tensor's data pointer (useful for mmap-ed data)
365
- ///
366
- /// # Safety
367
- ///
368
- /// The memory region from `data_ptr` to `data_ptr.offset(tensor.nbytes())` will be read from.
369
- pub unsafe fn set_data ( & self , data_ptr : * mut c_void ) {
370
- self . with_alive_ctx ( || {
371
- // SAFETY: The with_alive_call guarantees the context is alive
372
- unsafe { * self . ptr . as_ptr ( ) } . data = data_ptr;
373
- } )
374
- }
364
+ // // / Set the tensor's data pointer (useful for mmap-ed data)
365
+ // // /
366
+ // // / # Safety
367
+ // ///
368
+ // // / The memory region from `data_ptr` to `data_ptr.offset(tensor.nbytes())` will be read from.
369
+ // pub unsafe fn set_data(&self, data_ptr: *mut c_void) {
370
+ // self.with_alive_ctx(|| {
371
+ // // SAFETY: The with_alive_call guarantees the context is alive
372
+ // unsafe { *self.ptr.as_ptr() }.data = data_ptr;
373
+ // })
374
+ // }
375
375
376
376
/// Number of elements in this tensor.
377
377
pub fn nelements ( & self ) -> usize {
Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ pub(crate) fn load_weights_ggmf_or_unversioned(
173
173
byte_size : total_size,
174
174
tensor_count : n_tensors. try_into ( ) ?,
175
175
} ) ;
176
- } ;
176
+ }
177
177
Ok ( ( ) )
178
178
}
179
179
@@ -264,7 +264,6 @@ fn load_tensor_header_ggmf<'a>(
264
264
}
265
265
266
266
fn tensor_type_size ( ftype : i32 , ne : [ i64 ; 2 ] ) -> Option < usize > {
267
-
268
267
match ftype {
269
268
0 => Some ( ggml:: type_size ( ggml:: Type :: F32 ) ) ,
270
269
1 => Some ( ggml:: type_size ( ggml:: Type :: F16 ) ) ,
You can’t perform that action at this time.
0 commit comments