summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 796d0e4..e8f7740 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,4 +1,4 @@
-use mdarray::{view, array, tensor, Slice, Dim, Const, expr::Expression};
+use mdarray::{view, tensor, Slice, Dim, Const, expr::Expression};
use mdarray as md;
// Indexing convention: C_ij <- A_ik * B_kj
@@ -17,7 +17,9 @@ fn matmul<D0: Dim, D1: Dim, D2: Dim>(
fn main() {
let a = view![[1.0, 4.0], [2.0, 5.0], [3.0, 6.0]];
- let b = array![[0.0, 1.0], [1.0, 1.0]];
+ let b = md::Array::<f64, (Const::<2>, Const::<2>)>::from_fn(
+ |i| if i[0] == 0 && i[1] == 0 { 0.0 } else { 1.0 }
+ );
let b = b.reshape((Const::<2>, !0));
// .into_dyn() replaces .reshape(DynRank::from_dims(&[2, 3])).into():