 
 ! Sum together all elements in the tensor
 syntax:M: tensor sum vec>> 0 <simd-slice>
-    [ simd-slice>> 0 [ sum + ] reduce ]
+    [ simd-slice>> [ sum ] map-sum ]
     [ end-slice>> sum ] bi + ;
 
 <PRIVATE


! Construct a tensor with vec { 0 1 2 ... } and reshape to the desired shape
: naturals ( shape -- tensor )
    check-shape [ ] [ product [0..b) >float-array ] bi <tensor> ;

! Construct a tensor without initializing its values
: (tensor) ( shape -- tensor )


! Flatten the tensor so that it is only one-dimensional
: flatten ( tensor -- tensor )
    dup shape>> product { } 1sequence >>shape ;

! outputs the number of dimensions of a tensor
: dims ( tensor -- n )
