1 ! Copyright (C) 2019 HMC Clinic.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors alien.c-types arrays kernel math math.order math.vectors
4 sequences specialized-arrays tensors tools.test ;
5 QUALIFIED-WITH: alien.c-types c
6 SPECIALIZED-ARRAY: c:float
10 { float-array{ 0.0 0.0 0.0 0.0 } } [
18 { float-array{ 0.0 0.0 0.0 0.0 } } [
29 [ { 0 5 } \ non-positive-shape-error boa = ] must-fail-with
34 [ { -3 5 } \ non-positive-shape-error boa = ] must-fail-with
37 { float-array{ 1.0 1.0 1.0 1.0 } } [
45 { float-array{ 1.0 1.0 1.0 1.0 } } [
56 [ { 0 5 } \ non-positive-shape-error boa = ] must-fail-with
61 [ { -3 5 } \ non-positive-shape-error boa = ] must-fail-with
65 { { 4 } float-array{ 0. 1. 2. 3. } } [
66 0 3 1 arange [ shape>> ] [ vec>> ] bi
69 { { 4 } float-array{ 0. 2. 4. 6. } } [
70 0 7 2 arange [ shape>> ] [ vec>> ] bi
73 { { 3 } float-array{ 1. 4. 7. } } [
74 1 9 3 arange [ shape>> ] [ vec>> ] bi
77 { { 5 } float-array{ 1. 3. 5. 7. 9. } } [
78 1 9 2 arange [ shape>> ] [ vec>> ] bi
83 { float-array{ 0.0 1.0 2.0 3.0 } } [
88 { 4 } naturals shape>>
91 { float-array{ 0.0 1.0 2.0 3.0 } } [
92 { 2 2 } naturals vec>>
96 { 2 2 } naturals shape>>
102 [ { 0 5 } \ non-positive-shape-error boa = ] must-fail-with
107 [ { -3 5 } \ non-positive-shape-error boa = ] must-fail-with
111 { 2 4 } (tensor) shape>>
115 { 0 } (tensor) shape>>
124 { float-array{ 0.0 0.0 0.0 0.0 } } [
125 { 4 } zeros { 2 2 } reshape vec>>
129 { 4 } zeros { 2 2 } reshape shape>>
133 { 2 2 } zeros { 2 3 } reshape
135 [ { 2 2 } { 2 3 } \ shape-mismatch-error boa = ] must-fail-with
138 { 2 2 } zeros { -2 -2 } reshape
140 [ { -2 -2 } \ non-positive-shape-error boa = ] must-fail-with
143 { float-array{ 0.0 0.0 0.0 0.0 } } [
144 { 2 2 } zeros flatten vec>>
148 { 2 2 } zeros flatten shape>>
151 { float-array{ 0.0 0.0 0.0 0.0 } } [
152 { 4 } zeros flatten vec>>
156 { 4 } zeros flatten shape>>
172 ! Test sequence operations
173 ! TODO: add tests for clone-like
176 { 2 2 5 } naturals length
185 10 { 2 5 } ones new-sequence shape>> product
189 2 { 3 4 5 } ones new-sequence shape>> product
193 20 { 2 5 } ones new-sequence shape>> product
202 { 1 } { 5 } naturals nth
206 { 1 1 } { 2 2 } naturals nth
210 { 1 0 1 } { 2 2 2 } naturals nth
214 { 1 2 3 } t{ 1 2 3 } nth
216 [ 1 3 \ dimension-mismatch-error boa = ] must-fail-with
220 t{ 1 2 3 } dup [ 5 { 1 } ] dip set-nth
223 { t{ { 0 1 } { 5 3 } } } [
224 { 2 2 } naturals dup [ 5 { 1 0 } ] dip set-nth
227 { t{ { { 0 1 } { 2 3 } } { { 4 10 } { 6 7 } } } } [
228 { 2 2 2 } naturals dup [ 10 { 1 0 1 } ] dip set-nth
232 { 2 2 } naturals dup [ 5 { 1 } ] dip set-nth
234 [ 2 1 \ dimension-mismatch-error boa = ] must-fail-with
238 t{ 1 2 3 } dup clone [ 5 1 ] dip set-nth
242 t{ 1 2 3 } dup clone =
246 t{ 1 2 3 } dup clone dup [ 5 1 ] dip set-nth =
250 { float-array{ 0.0 1.0 2.0 3.0 4.0 5.0 } } [
251 { 2 3 } naturals dup like vec>>
255 { 2 3 } naturals dup like shape>>
258 { float-array{ 0.0 1.0 2.0 3.0 4.0 5.0 } } [
259 { 0 1 2 3 4 5 } { 2 3 } naturals like vec>>
263 { 0 1 2 3 4 5 } { 2 3 } naturals like shape>>
266 { float-array{ 0.0 1.0 2.0 3.0 4.0 5.0 } } [
267 float-array{ 0 1 2 3 4 5 } { 2 3 } naturals like vec>>
271 float-array{ 0 1 2 3 4 5 } { 2 3 } naturals like shape>>
274 { float-array{ 0.0 1.0 2.0 3.0 4.0 } } [
275 { 0 1 2 3 4 } { 2 3 } naturals like vec>>
279 { 0 1 2 3 4 } { 2 3 } naturals like shape>>
282 { float-array{ 0.0 1.0 2.0 3.0 4.0 } } [
283 float-array{ 0 1 2 3 4 } { 2 3 } naturals like vec>>
287 float-array{ 0 1 2 3 4 } { 2 3 } naturals like shape>>
290 { t{ { 0.0 1.0 } { 2.0 3.0 } } } [
291 { { 0 1 } { 2 3 } } t{ } like
295 { float-array{ 1.0 2.0 3.0 } } [
296 { 1 2 3 } t{ } clone-like vec>>
300 float-array{ 1.0 2.0 3.0 } dup t{ } clone-like
301 dup [ 5 1 ] dip set-nth vec>> =
310 { 100 100 } naturals 1 t+ sum
313 ! Test tensor parsing word
314 { float-array{ 1 2 3 4 5 6 7 8 } } [
315 t{ 1 2 3 4 5 6 7 8 } vec>>
319 t{ 1 2 3 4 5 6 7 8 } shape>>
322 { float-array{ 1 2 3 4 5 6 7 8 } } [
323 t{ { 1 2 3 4 } { 5 6 7 8 } } vec>>
327 t{ { 1 2 3 4 } { 5 6 7 8 } } shape>>
330 { float-array{ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 } } [
331 t{ { { 1 2 3 4 } { 5 6 7 8 } { 9 10 11 12 } } { { 13 14 15 16 } { 17 18 19 20 } { 21 22 23 24 } } } vec>>
335 t{ { { 1 2 3 4 } { 5 6 7 8 } { 9 10 11 12 } } { { 13 14 15 16 } { 17 18 19 20 } { 21 22 23 24 } } } shape>>
340 { float-array{ 1.0 2.0 3.0 4.0 } } [
341 { 4 } naturals { 4 } ones t+ vec>>
345 { 4 } naturals { 4 } ones t+ shape>>
348 { float-array{ 1.0 2.0 3.0 4.0 } } [
349 { 2 2 } naturals { 2 2 } ones t+ vec>>
353 { 2 2 } naturals { 2 2 } ones t+ shape>>
357 { 3 } naturals { 2 2 } ones t+ vec>>
359 [ { 3 } { 2 2 } \ shape-mismatch-error boa = ] must-fail-with
362 { 4 } naturals { 2 2 } ones t+ vec>>
364 [ { 4 } { 2 2 } \ shape-mismatch-error boa = ] must-fail-with
366 ! Test scalar addition
367 { float-array{ 1.0 2.0 3.0 4.0 } } [
368 { 4 } naturals 1 t+ vec>>
372 { 4 } naturals 1 t+ shape>>
375 { float-array{ 1.0 2.0 3.0 4.0 } } [
376 1 { 4 } naturals t+ vec>>
380 1 { 4 } naturals t+ shape>>
384 { float-array{ -1.0 0.0 1.0 2.0 } } [
385 { 4 } naturals { 4 } ones t- vec>>
389 { 4 } naturals { 4 } ones t- shape>>
392 { float-array{ -1.0 0.0 1.0 2.0 } } [
393 { 2 2 } naturals { 2 2 } ones t- vec>>
397 { 2 2 } naturals { 2 2 } ones t- shape>>
401 { 3 } naturals { 2 2 } ones t- vec>>
403 [ { 3 } { 2 2 } \ shape-mismatch-error boa = ] must-fail-with
406 { 4 } naturals { 2 2 } ones t- vec>>
408 [ { 4 } { 2 2 } \ shape-mismatch-error boa = ] must-fail-with
410 ! Test scalar subtraction
411 { float-array{ -1.0 0.0 1.0 2.0 } } [
412 { 4 } naturals 1 t- vec>>
416 { 4 } naturals 1 t- shape>>
419 { float-array{ 1.0 0.0 -1.0 -2.0 } } [
420 1 { 4 } naturals t- vec>>
424 1 { 4 } naturals t- shape>>
427 ! Test multiplication
428 { float-array{ 0.0 1.0 4.0 9.0 } } [
429 { 4 } naturals { 4 } naturals t* vec>>
433 { 4 } naturals { 4 } naturals t* shape>>
436 { float-array{ 0.0 1.0 4.0 9.0 } } [
437 { 2 2 } naturals { 2 2 } naturals t* vec>>
441 { 2 2 } naturals { 2 2 } naturals t* shape>>
445 { 3 } naturals { 2 2 } naturals t* vec>>
447 [ { 3 } { 2 2 } \ shape-mismatch-error boa = ] must-fail-with
450 { 4 } naturals { 2 2 } naturals t* vec>>
452 [ { 4 } { 2 2 } \ shape-mismatch-error boa = ] must-fail-with
457 { 4 } naturals { 4 } ones t+
459 { 1.0 0.5 0.33333 0.25 } v-
461 0 [ max ] reduce 0.0001 <
466 { 4 } naturals { 4 } ones t+
472 { 2 2 } naturals { 2 2 } ones t+
474 { 1.0 0.5 0.33333 0.25 } v-
476 0 [ max ] reduce 0.0001 <
481 { 2 2 } naturals { 2 2 } ones t+
487 { 2 2 } naturals { 2 2 } ones t+
490 [ { 3 } { 2 2 } \ shape-mismatch-error boa = ] must-fail-with
494 { 2 2 } naturals { 2 2 } ones t+
497 [ { 4 } { 2 2 } \ shape-mismatch-error boa = ] must-fail-with
499 ! Test scalar division
502 { 4 } naturals { 4 } ones t+
504 { 1.0 0.5 0.33333 0.25 } v-
506 0 [ max ] reduce 0.0001 <
511 { 4 } naturals { 4 } ones t+
515 { float-array{ 0.0 0.5 1.0 1.5 } } [
516 { 4 } naturals 2 t/ vec>>
520 { 4 } naturals 2 t/ shape>>
523 ! Test scalar multiplication
524 { float-array{ 0.0 3.0 6.0 9.0 } } [
525 { 4 } naturals 3 t* vec>>
529 { 4 } naturals 3 t* shape>>
532 { float-array{ 0.0 3.0 6.0 9.0 } } [
533 { 2 2 } naturals 3 t* vec>>
537 { 2 2 } naturals 3 t* shape>>
540 { float-array{ 0.0 3.0 6.0 9.0 } } [
541 3 { 4 } naturals t* vec>>
545 3 { 4 } naturals t* shape>>
548 { float-array{ 0.0 3.0 6.0 9.0 } } [
549 3 { 2 2 } naturals t* vec>>
553 3 { 2 2 } naturals t* shape>>
557 { float-array{ 0.0 1.0 2.0 0.0 1.0 } } [
569 { float-array{ 0.0 1.0 2.0 0.0 1.0 2.0 } } [
586 [ { 4 } { 2 3 } \ shape-mismatch-error boa = ] must-fail-with
593 [ { 4 } { 2 3 } \ shape-mismatch-error boa = ] must-fail-with
596 { float-array{ 0.0 1.0 2.0 0.0 1.0 } } [
608 { float-array{ 0.0 1.0 2.0 0.0 1.0 2.0 } } [
620 { float-array{ 0.0 1.0 0.0 3.0 3.0 } } [
632 { float-array{ 0.0 1.0 0.0 3.0 3.0 3.0 } } [
634 { 2 3 } naturals 1 t+
645 { t{ { 0.0 1.0 2.0 } { 3.0 4.0 5.0 } { 0.0 1.0 2.0 } { 3.0 4.0 5.0 } } } [
646 { 2 3 } naturals dup 2array t-concat
649 { t{ { 0.0 1.0 2.0 } { 3.0 4.0 5.0 } { 0.0 1.0 2.0 } { 3.0 4.0 5.0 }
650 { 0.0 1.0 2.0 } { 3.0 4.0 5.0 } } } [
651 { 2 3 } naturals dup dup 3array t-concat
660 { 12.0 13.0 14.0 } } } [
661 { 2 3 } naturals { 5 3 } naturals 2array t-concat
664 { t{ { { 0.0 1.0 } { 2.0 3.0 } { 4.0 5.0 } }
665 { { 6.0 7.0 } { 8.0 9.0 } { 10.0 11.0 } }
666 { { 0.0 1.0 } { 2.0 3.0 } { 4.0 5.0 } }
667 { { 6.0 7.0 } { 8.0 9.0 } { 10.0 11.0 } } } } [
668 { 2 3 2 } naturals dup 2array t-concat
671 { t{ { { 0.0 1.0 } { 2.0 3.0 } { 4.0 5.0 } }
672 { { 6.0 7.0 } { 8.0 9.0 } { 10.0 11.0 } }
673 { { 0.0 1.0 } { 2.0 3.0 } { 4.0 5.0 } }
674 { { 6.0 7.0 } { 8.0 9.0 } { 10.0 11.0 } }
675 { { 0.0 1.0 } { 2.0 3.0 } { 4.0 5.0 } }
676 { { 6.0 7.0 } { 8.0 9.0 } { 10.0 11.0 } } } } [
677 { 2 3 2 } naturals dup dup 3array t-concat
681 { 2 2 } naturals { 2 3 } naturals 2array t-concat
683 [ { 2 2 } { 2 3 } \ shape-mismatch-error boa = ] must-fail-with
686 { 2 2 } naturals dup { 2 3 } naturals 3array t-concat
688 [ { 2 2 } { 2 3 } \ shape-mismatch-error boa = ] must-fail-with
691 { t{ { { 0.0 1.0 2.0 } { 3.0 4.0 5.0 } }
692 { { 0.0 1.0 2.0 } { 3.0 4.0 5.0 } } } } [
693 { 2 3 } naturals dup 2array stack
696 { t{ { { 0.0 1.0 2.0 } { 3.0 4.0 5.0 } }
697 { { 0.0 1.0 2.0 } { 3.0 4.0 5.0 } }
698 { { 0.0 1.0 2.0 } { 3.0 4.0 5.0 } } } } [
699 { 2 3 } naturals dup dup 3array stack
702 { t{ { { { 0.0 1.0 } { 2.0 3.0 } { 4.0 5.0 } }
703 { { 6.0 7.0 } { 8.0 9.0 } { 10.0 11.0 } } }
704 { { { 0.0 1.0 } { 2.0 3.0 } { 4.0 5.0 } }
705 { { 6.0 7.0 } { 8.0 9.0 } { 10.0 11.0 } } } } } [
706 { 2 3 2 } naturals dup 2array stack
709 { t{ { { { 0.0 1.0 } { 2.0 3.0 } { 4.0 5.0 } }
710 { { 6.0 7.0 } { 8.0 9.0 } { 10.0 11.0 } } }
711 { { { 0.0 1.0 } { 2.0 3.0 } { 4.0 5.0 } }
712 { { 6.0 7.0 } { 8.0 9.0 } { 10.0 11.0 } } }
713 { { { 0.0 1.0 } { 2.0 3.0 } { 4.0 5.0 } }
714 { { 6.0 7.0 } { 8.0 9.0 } { 10.0 11.0 } } } } } [
715 { 2 3 2 } naturals dup dup 3array stack
719 { 2 2 } naturals { 2 3 } naturals 2array stack
721 [ { 2 2 } { 2 3 } \ shape-mismatch-error boa = ] must-fail-with
724 { 2 2 } naturals { 3 2 } naturals 2array stack
726 [ { 2 2 } { 3 2 } \ shape-mismatch-error boa = ] must-fail-with
729 { 2 2 } naturals dup { 2 3 } naturals 3array stack
731 [ { 2 2 } { 2 3 } \ shape-mismatch-error boa = ] must-fail-with
734 { 2 2 } naturals dup { 3 2 } naturals 3array stack
736 [ { 2 2 } { 3 2 } \ shape-mismatch-error boa = ] must-fail-with
740 { t{ { 0.0 1.0 2.0 3.0 1.0 }
741 { 4.0 5.0 6.0 7.0 1.0 }
742 { 8.0 9.0 10.0 11.0 1.0 } } } [
743 { 3 4 } naturals { 3 1 } ones 2array hstack
746 { t{ { 0.0 1.0 2.0 3.0 1.0 0.0 0.0 }
747 { 4.0 5.0 6.0 7.0 1.0 0.0 0.0 }
748 { 8.0 9.0 10.0 11.0 1.0 0.0 0.0 } } } [
749 { 3 4 } naturals { 3 1 } ones { 3 2 } zeros 3array hstack
752 { t{ { { 0.0 1.0 2.0 3.0 1.0 } { 4.0 5.0 6.0 7.0 1.0 } }
753 { { 8.0 9.0 10.0 11.0 1.0 } { 12.0 13.0 14.0 15.0 1.0 } } } } [
754 { 2 2 4 } naturals { 2 2 1 } ones 2array hstack
757 { t{ { { 0.0 1.0 2.0 3.0 1.0 0.0 0.0 }
758 { 4.0 5.0 6.0 7.0 1.0 0.0 0.0 } }
759 { { 8.0 9.0 10.0 11.0 1.0 0.0 0.0 }
760 { 12.0 13.0 14.0 15.0 1.0 0.0 0.0 } } } } [
761 { 2 2 4 } naturals { 2 2 1 } ones { 2 2 2 } zeros 3array hstack
765 { 2 2 } naturals { 3 2 } naturals 2array hstack
767 [ { 2 2 } { 3 2 } \ shape-mismatch-error boa = ] must-fail-with
770 { 2 2 } naturals dup { 3 2 } naturals 3array hstack
772 [ { 2 2 } { 3 2 } \ shape-mismatch-error boa = ] must-fail-with
775 { 2 2 2 } naturals { 3 2 2 } naturals 2array hstack
777 [ { 2 2 2 } { 3 2 2 } \ shape-mismatch-error boa = ] must-fail-with
780 { 2 2 2 } naturals dup { 3 2 2 } naturals 3array hstack
782 [ { 2 2 2 } { 3 2 2 } \ shape-mismatch-error boa = ] must-fail-with
785 { t{ { 0.0 1.0 } { 2.0 3.0 } { 4.0 5.0 } { 0.0 1.0 } } } [
786 { 3 2 } naturals { 1 2 } naturals 2array vstack
789 { t{ { 0.0 1.0 } { 2.0 3.0 } { 4.0 5.0 }
790 { 0.0 1.0 } { 0.0 1.0 } { 2.0 3.0 } } } [
791 { 3 2 } naturals { 1 2 } naturals { 2 2 } naturals 3array vstack
794 { t{ { { 0.0 1.0 } { 2.0 3.0 } { 4.0 5.0 } { 0.0 1.0 } }
795 { { 6.0 7.0 } { 8.0 9.0 } { 10.0 11.0 } { 2.0 3.0 } } } } [
796 { 2 3 2 } naturals { 2 1 2 } naturals 2array vstack
799 { t{ { { 0.0 1.0 } { 2.0 3.0 } { 4.0 5.0 }
800 { 0.0 1.0 } { 0.0 1.0 } { 2.0 3.0 } }
801 { { 6.0 7.0 } { 8.0 9.0 } { 10.0 11.0 }
802 { 2.0 3.0 } { 4.0 5.0 } { 6.0 7.0 } } } } [
803 { 2 3 2 } naturals { 2 1 2 } naturals { 2 2 2 } naturals 3array vstack
807 { 2 2 } naturals { 2 3 } naturals 2array vstack
809 [ { 2 2 } { 2 3 } \ shape-mismatch-error boa = ] must-fail-with
812 { 2 2 } naturals dup { 2 3 } naturals 3array vstack
814 [ { 2 2 } { 2 3 } \ shape-mismatch-error boa = ] must-fail-with
817 { 2 2 2 } naturals { 3 2 2 } naturals 2array vstack
819 [ { 2 2 2 } { 3 2 2 } \ shape-mismatch-error boa = ] must-fail-with
822 { 2 2 2 } naturals dup { 3 2 2 } naturals 3array vstack
824 [ { 2 2 2 } { 3 2 2 } \ shape-mismatch-error boa = ] must-fail-with
828 { 2 } zeros tensor>array
831 { { { 0.0 0.0 } { 0.0 0.0 } } } [
832 { 2 2 } zeros tensor>array
835 { { { { 1.0 1.0 } { 1.0 1.0 } { 1.0 1.0 } }
836 { { 1.0 1.0 } { 1.0 1.0 } { 1.0 1.0 } } } } [
837 { 2 3 2 } ones tensor>array
842 { 2 3 4 } naturals dup tensor>array >tensor =
846 { { { 1.0 2.0 } { 3.0 4.0 } }
847 { { 5.0 6.0 } { 7.0 8.0 } }
848 { { 9.0 10.0 } { 11.0 12.0 } } }
849 dup >tensor tensor>array =
854 { { 0 1 2 } { 3 4 5 } } >tensor =
858 { { 1 2 } { 3 } } >tensor
860 [ { { 1 2 } { 3 } } \ non-uniform-seq-error boa = ] must-fail-with
871 { float-array{ 70.0 76.0 82.0 88.0 94.0 190.0 212.0 234.0
872 256.0 278.0 310.0 348.0 386.0 424.0 462.0 } } [
873 { 3 4 } naturals { 4 5 } naturals matmul vec>>
877 { 3 4 } naturals { 4 5 } naturals matmul shape>>
880 { float-array{ 70.0 76.0 82.0 88.0 94.0 190.0 212.0 234.0 256.0
881 278.0 310.0 348.0 386.0 424.0 462.0 1510.0 1564.0
882 1618.0 1672.0 1726.0 1950.0 2020.0 2090.0 2160.0
883 2230.0 2390.0 2476.0 2562.0 2648.0 2734.0 } } [
884 { 2 3 4 } naturals { 2 4 5 } naturals matmul vec>>
888 { 2 3 4 } naturals { 2 4 5 } naturals matmul shape>>
891 { float-array{ 70.0 76.0 82.0 88.0 94.0 190.0 212.0 234.0 256.0
892 278.0 310.0 348.0 386.0 424.0 462.0 1510.0 1564.0 1618.0
893 1672.0 1726.0 1950.0 2020.0 2090.0 2160.0 2230.0 2390.0 2476.0
894 2562.0 2648.0 2734.0 4870.0 4972.0 5074.0 5176.0 5278.0 5630.0
895 5748.0 5866.0 5984.0 6102.0 6390.0 6524.0 6658.0 6792.0 6926.0
896 10150.0 10300.0 10450.0 10600.0 10750.0 11230.0 11396.0 11562.0
897 11728.0 11894.0 12310.0 12492.0 12674.0 12856.0 13038.0 } } [
898 { 2 2 3 4 } naturals { 2 2 4 5 } naturals matmul vec>>
902 { 2 2 3 4 } naturals { 2 2 4 5 } naturals matmul shape>>
905 ! where n mod 4 is not 0 and m & p have same mod 4 val
906 { float-array{ 45.0 48.0 51.0 54.0 57.0 60.0 63.0 66.0 69.0 126.0
907 138.0 150.0 162.0 174.0 186.0 198.0 210.0 222.0 207.0 228.0
908 249.0 270.0 291.0 312.0 333.0 354.0 375.0 288.0 318.0 348.0
909 378.0 408.0 438.0 468.0 498.0 528.0 369.0 408.0 447.0 486.0
910 525.0 564.0 603.0 642.0 681.0 } } [
911 { 5 3 } naturals { 3 9 } naturals matmul vec>>
914 ! where n mod 4 is not 0 and m & p have same mod 4 val
915 { float-array{ 270.0 280.0 290.0 300.0 310.0 320.0 330.0 340.0 350.0
916 720.0 755.0 790.0 825.0 860.0 895.0 930.0 965.0 1000.0
917 1170.0 1230.0 1290.0 1350.0 1410.0 1470.0 1530.0 1590.0
918 1650.0 1620.0 1705.0 1790.0 1875.0 1960.0 2045.0 2130.0
919 2215.0 2300.0 2070.0 2180.0 2290.0 2400.0 2510.0 2620.0
920 2730.0 2840.0 2950.0 } } [
921 { 5 5 } naturals { 5 9 } naturals matmul vec>>
924 ! where n mod 4 is not 0 and m & p have different mod 4 vals
925 { float-array{ 35.0 38.0 41.0 44.0 47.0 50.0 53.0 98.0 110.0
926 122.0 134.0 146.0 158.0 170.0 161.0 182.0 203.0 224.0
927 245.0 266.0 287.0 224.0 254.0 284.0 314.0 344.0 374.0
928 404.0 287.0 326.0 365.0 404.0 443.0 482.0 521.0 } } [
929 { 5 3 } naturals { 3 7 } naturals matmul vec>>
932 { float-array{ 546.0 567.0 588.0 609.0 630.0 651.0 1428.0 1498.0 1568.0 1638.0
933 1708.0 1778.0 2310.0 2429.0 2548.0 2667.0 2786.0 2905.0 3192.0 3360.0
934 3528.0 3696.0 3864.0 4032.0 4074.0 4291.0 4508.0 4725.0 4942.0 5159.0
935 4956.0 5222.0 5488.0 5754.0 6020.0 6286.0 5838.0 6153.0 6468.0 6783.0
936 7098.0 7413.0 22008.0 22372.0 22736.0 23100.0 23464.0 23828.0 24948.0
937 25361.0 25774.0 26187.0 26600.0 27013.0 27888.0 28350.0 28812.0 29274.0
938 29736.0 30198.0 30828.0 31339.0 31850.0 32361.0 32872.0 33383.0 33768.0
939 34328.0 34888.0 35448.0 36008.0 36568.0 36708.0 37317.0 37926.0 38535.0
940 39144.0 39753.0 39648.0 40306.0 40964.0 41622.0 42280.0 42938.0 } } [
941 { 2 7 7 } naturals { 2 7 6 } naturals matmul vec>>
945 { float-array{ 0.0 2.0 1.0 3.0 } } [
946 { 2 2 } naturals transpose vec>>
949 { float-array{ 0.0 12.0 4.0 16.0 8.0 20.0 1.0
950 13.0 5.0 17.0 9.0 21.0 2.0 14.0 6.0 18.0
951 10.0 22.0 3.0 15.0 7.0 19.0 11.0 23.0 } } [
952 { 2 3 4 } naturals transpose vec>>
956 { 2 3 4 } naturals transpose shape>>
960 { 2 3 4 5 6 } naturals dup transpose transpose =