Skip to content

Commit 1371788

Browse files
committed
Update to v0.6.1
1 parent 036d8ce commit 1371788

3 files changed

Lines changed: 31 additions & 23 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## v0.6.1 -- 2025-11-15
4+
5+
MSRV specified to 1.82.0, written to Cargo.toml.
6+
7+
Functionality changes:
8+
9+
- rstsr-core: `asarray` will not panic when layout is not compact if pass `&[T]` or `&mut [T]` to give view/mut-view tensor. However, pass `Vec<T>` to give owned tensor will still panic if layout is not compact.
10+
311
## v0.6.0 -- 2025-11-03
412

513
Refactor:

Cargo.toml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ members = [
1818
]
1919

2020
[workspace.package]
21-
version = "0.6.0"
21+
version = "0.6.1"
2222
edition = "2021"
2323
rust-version = "1.82.0"
2424
description = "An n-Dimension Rust Tensor Toolkit"
@@ -28,24 +28,24 @@ categories = ["science"]
2828
license = "Apache-2.0"
2929

3030
[workspace.dependencies]
31-
rstsr = { path = "./rstsr", default-features = false, version = "0.6.0" }
32-
rstsr-core = { path = "./rstsr-core", default-features = false, version = "0.6.0" }
31+
rstsr = { path = "./rstsr", default-features = false, version = "0.6.1" }
32+
rstsr-core = { path = "./rstsr-core", default-features = false, version = "0.6.1" }
3333
# members (without core)
34-
rstsr-common = { path = "./rstsr-common", default-features = false, version = "0.6.0" }
35-
rstsr-dtype-traits = { path = "./rstsr-dtype-traits", default-features = false, version = "0.6.0" }
36-
rstsr-native-impl = { path = "./rstsr-native-impl", default-features = false, version = "0.6.0" }
34+
rstsr-common = { path = "./rstsr-common", default-features = false, version = "0.6.1" }
35+
rstsr-dtype-traits = { path = "./rstsr-dtype-traits", default-features = false, version = "0.6.1" }
36+
rstsr-native-impl = { path = "./rstsr-native-impl", default-features = false, version = "0.6.1" }
3737
# members (traits and core-extensions)
38-
rstsr-blas-traits = { path = "./rstsr-blas-traits", default-features = false, version = "0.6.0" }
39-
rstsr-linalg-traits = { path = "./rstsr-linalg-traits", default-features = false, version = "0.6.0" }
40-
rstsr-sci-traits = { path = "./rstsr-sci-traits", default-features = false, version = "0.6.0" }
38+
rstsr-blas-traits = { path = "./rstsr-blas-traits", default-features = false, version = "0.6.1" }
39+
rstsr-linalg-traits = { path = "./rstsr-linalg-traits", default-features = false, version = "0.6.1" }
40+
rstsr-sci-traits = { path = "./rstsr-sci-traits", default-features = false, version = "0.6.1" }
4141
# members (device)
42-
rstsr-openblas = { path = "./crates-device/rstsr-openblas", default-features = false, version = "0.6.0" }
43-
rstsr-mkl = { path = "./crates-device/rstsr-mkl", default-features = false, version = "0.6.0" }
44-
rstsr-blis = { path = "./crates-device/rstsr-blis", default-features = false, version = "0.6.0" }
45-
rstsr-aocl = { path = "./crates-device/rstsr-aocl", default-features = false, version = "0.6.0" }
46-
rstsr-kml = { path = "./crates-device/rstsr-kml", default-features = false, version = "0.6.0" }
42+
rstsr-openblas = { path = "./crates-device/rstsr-openblas", default-features = false, version = "0.6.1" }
43+
rstsr-mkl = { path = "./crates-device/rstsr-mkl", default-features = false, version = "0.6.1" }
44+
rstsr-blis = { path = "./crates-device/rstsr-blis", default-features = false, version = "0.6.1" }
45+
rstsr-aocl = { path = "./crates-device/rstsr-aocl", default-features = false, version = "0.6.1" }
46+
rstsr-kml = { path = "./crates-device/rstsr-kml", default-features = false, version = "0.6.1" }
4747
# members (plugin)
48-
rstsr-tblis = { path = "./crates-plugin/rstsr-tblis", default-features = false, version = "0.6.0" }
48+
rstsr-tblis = { path = "./crates-plugin/rstsr-tblis", default-features = false, version = "0.6.1" }
4949
# develop dependencies that should not publish
5050
rstsr-test-manifest = { path = "./rstsr-test-manifest", default-features = false }
5151
# ffi dependencies

rstsr-core/src/tensor/asarray.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ where
335335
let mut storage_c = device.uninit_impl(layout_c.size())?;
336336
device.assign_uninit(storage_c.raw_mut(), &layout_c, input.raw(), layout_a)?;
337337
let storage_c = unsafe { B::assume_init_impl(storage_c) }?;
338-
let tensor = unsafe { Tensor::new_unchecked(storage_c, layout_c) };
338+
let tensor = Tensor::new_f(storage_c, layout_c)?;
339339
return Ok(tensor);
340340
}
341341
}
@@ -374,7 +374,7 @@ where
374374
let mut storage_c = device.uninit_impl(layout_c.size())?;
375375
device.assign_uninit(storage_c.raw_mut(), &layout_c, storage_a.raw(), layout_a)?;
376376
let storage_c = unsafe { B::assume_init_impl(storage_c) }?;
377-
let tensor = unsafe { Tensor::new_unchecked(storage_c, layout_c) };
377+
let tensor = Tensor::new_f(storage_c, layout_c)?;
378378
return Ok(tensor);
379379
}
380380
}
@@ -434,7 +434,7 @@ where
434434
let (input, device) = self;
435435
let layout = vec![input.len()].c();
436436
let storage = device.outof_cpu_vec(input)?;
437-
let tensor = unsafe { Tensor::new_unchecked(storage, layout) };
437+
let tensor = Tensor::new_f(storage, layout)?;
438438
return Ok(tensor);
439439
}
440440
}
@@ -461,7 +461,7 @@ where
461461
"This constructor assumes that the layout size is equal to the input size."
462462
)?;
463463
let storage = device.outof_cpu_vec(input)?;
464-
let tensor = unsafe { Tensor::new_unchecked(storage, layout.into_dim()?) };
464+
let tensor = Tensor::new_f(storage, layout.into_dim()?)?;
465465
return Ok(tensor);
466466
}
467467
}
@@ -541,7 +541,7 @@ where
541541
let device = device.clone();
542542
let data = DataRef::from_manually_drop(ManuallyDrop::new(raw));
543543
let storage = Storage::new(data, device);
544-
let tensor = unsafe { TensorView::new_unchecked(storage, layout.into_dim()?) };
544+
let tensor = TensorView::new_f(storage, layout.into_dim()?)?;
545545
return Ok(tensor);
546546
}
547547
}
@@ -585,7 +585,7 @@ where
585585
};
586586
let data = DataRef::from_manually_drop(ManuallyDrop::new(raw));
587587
let storage = Storage::new(data, device);
588-
let tensor = unsafe { TensorView::new_unchecked(storage, layout) };
588+
let tensor = TensorView::new_f(storage, layout)?;
589589
return Ok(tensor);
590590
}
591591
}
@@ -709,7 +709,7 @@ where
709709
let device = device.clone();
710710
let data = DataMut::from_manually_drop(ManuallyDrop::new(raw));
711711
let storage = Storage::new(data, device);
712-
let tensor = unsafe { TensorMut::new_unchecked(storage, layout.into_dim()?) };
712+
let tensor = TensorMut::new_f(storage, layout.into_dim()?)?;
713713
return Ok(tensor);
714714
}
715715
}
@@ -753,7 +753,7 @@ where
753753
};
754754
let data = DataMut::from_manually_drop(ManuallyDrop::new(raw));
755755
let storage = Storage::new(data, device);
756-
let tensor = unsafe { TensorMut::new_unchecked(storage, layout.into_dim()?) };
756+
let tensor = TensorMut::new_f(storage, layout.into_dim()?)?;
757757
return Ok(tensor);
758758
}
759759
}

0 commit comments

Comments
 (0)