summaryrefslogtreecommitdiff
path: root/src/Array.hs
diff options
context:
space:
mode:
authorTom Smeding <t.j.smeding@uu.nl>2024-09-25 17:23:36 +0200
committerTom Smeding <t.j.smeding@uu.nl>2024-09-25 17:23:36 +0200
commitdd16337adb2cd93b808a41e95ae0d0946ac91395 (patch)
tree966f2851af5a083977829cbb764bd065f504f902 /src/Array.hs
parent76917de6d801e3667cdf3f1bbbb5c2bceabdecb6 (diff)
Test neural
Diffstat (limited to 'src/Array.hs')
-rw-r--r--src/Array.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Array.hs b/src/Array.hs
index 6473bf0..c48e442 100644
--- a/src/Array.hs
+++ b/src/Array.hs
@@ -59,6 +59,9 @@ arraySize (Array sh _) = shapeSize sh
emptyArray :: SNat n -> Array n t
emptyArray n = Array (emptyShape n) V.empty
+arrayFromList :: Shape n -> [t] -> Array n t
+arrayFromList sh l = Array sh (V.fromListN (shapeSize sh) l)
+
arrayUnit :: t -> Array Z t
arrayUnit x = Array ShNil (V.singleton x)