diff options
| -rw-r--r-- | Cargo.lock | 4 | ||||
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | src/main.rs | 11 |
3 files changed, 13 insertions, 4 deletions
@@ -1,11 +1,11 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "mdarray" version = "0.6.1" -source = "git+https://github.com/fre-hu/mdarray.git?rev=0bbaf1ab7c698c9a2903a56506b526f410c37165#0bbaf1ab7c698c9a2903a56506b526f410c37165" +source = "git+https://github.com/fre-hu/mdarray.git?rev=15e2531d1dfb6cde37b5c6770803dbdde034e6bc#15e2531d1dfb6cde37b5c6770803dbdde034e6bc" [[package]] name = "mdarray-test" @@ -4,4 +4,4 @@ version = "0.1.0" edition = "2021" [dependencies] -mdarray = { git = "https://github.com/fre-hu/mdarray.git", rev = "0bbaf1ab7c698c9a2903a56506b526f410c37165" } +mdarray = { git = "https://github.com/fre-hu/mdarray.git", rev = "15e2531d1dfb6cde37b5c6770803dbdde034e6bc" } diff --git a/src/main.rs b/src/main.rs index 3ba7bf2..796d0e4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ use mdarray::{view, array, tensor, Slice, Dim, Const, expr::Expression}; +use mdarray as md; // Indexing convention: C_ij <- A_ik * B_kj fn matmul<D0: Dim, D1: Dim, D2: Dim>( @@ -39,6 +40,14 @@ fn main() { dbg!(std::any::type_name_of_val(&e)); // permute - let f = c.permute((1, 0)); + let f = c.permute([1, 0]); dbg!(std::any::type_name_of_val(&f)); + + // Arrays with rank > 6: + let x: Vec<f64> = (0..128).map(|x| x as f64).collect(); + let x: md::DTensor<f64, 1> = x.into(); + let x = x.into_dyn(); + let x = x.reshape(&[2; 7]); + let x = x.permute(&[6, 5, 4, 3, 2, 1, 0]); + dbg!(std::any::type_name_of_val(&x)); } |
