burn-tensor
Advanced tools
| { | ||
| "git": { | ||
| "sha1": "cc0f22a5127c8ea45024092d635d159fcf50d666" | ||
| "sha1": "88d662d8bfaedc0d83a2151b184d599b37ead065" | ||
| }, | ||
| "path_in_vcs": "crates/burn-tensor" | ||
| } |
+5
-5
@@ -15,3 +15,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO | ||
| name = "burn-tensor" | ||
| version = "0.20.0-pre.2" | ||
| version = "0.20.0-pre.3" | ||
| authors = ["nathanielsimard <nathaniel.simard.42@gmail.com>"] | ||
@@ -94,7 +94,7 @@ build = false | ||
| [dependencies.burn-common] | ||
| version = "0.20.0-pre.2" | ||
| version = "=0.20.0-pre.3" | ||
| default-features = false | ||
| [dependencies.burn-tensor-testgen] | ||
| version = "0.20.0-pre.2" | ||
| version = "=0.20.0-pre.3" | ||
| optional = true | ||
@@ -111,3 +111,3 @@ | ||
| [dependencies.cubecl] | ||
| version = "0.9.0-pre.2" | ||
| version = "=0.9.0-pre.3" | ||
| optional = true | ||
@@ -117,3 +117,3 @@ default-features = false | ||
| [dependencies.cubecl-quant] | ||
| version = "0.9.0-pre.2" | ||
| version = "=0.9.0-pre.3" | ||
| default-features = false | ||
@@ -120,0 +120,0 @@ |
@@ -80,3 +80,3 @@ use core::any::TypeId; | ||
| fn split_i8_values(self, num_params: usize) -> (Vec<i8>, Vec<u32>) { | ||
| let mut values = self.bytes.try_into_vec::<i8>().unwrap(); | ||
| let mut values = read_bytes_to_i8(self.bytes); | ||
@@ -144,2 +144,12 @@ let scale_size = num_params * size_of::<f32>(); | ||
| fn read_bytes_to_i8(bytes: Bytes) -> Vec<i8> { | ||
| match bytes.try_into_vec::<i8>() { | ||
| Ok(val) => val, | ||
| // Safety, | ||
| // | ||
| // `Vec<u8>` can be Re-interpreted as `Vec<i8>` since they share the same alignment. | ||
| Err(bytes) => unsafe { core::mem::transmute::<Vec<u8>, Vec<i8>>(bytes.to_vec()) }, | ||
| } | ||
| } | ||
| #[cfg(test)] | ||
@@ -146,0 +156,0 @@ mod tests { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet