summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock4
-rw-r--r--Cargo.toml2
-rw-r--r--src/main.rs11
3 files changed, 13 insertions, 4 deletions
diff --git a/Cargo.lock b/Cargo.lock
index a07e6fa..8bf778f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -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"
diff --git a/Cargo.toml b/Cargo.toml
index 1822945..97d5598 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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));
}