Bugfix for the strided copy + add some assertions.

This commit is contained in:
laurent
2023-06-23 16:28:18 +01:00
parent bcfbb1dca1
commit 1936a1f0a3
3 changed files with 7 additions and 1 deletions

View File

@ -182,6 +182,9 @@ impl CpuStorage {
src_stride: &[usize],
dst_offset: usize,
) -> Result<()> {
if src_shape.rank() != src_stride.len() {
panic!("incoherent shape and strides {src_shape:?} {src_stride:?}")
}
match (self, dst) {
(Self::F32(src), Self::F32(dst)) => {
if src_shape.is_contiguous(src_stride) {