 
 ! 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

:: final-vstack-shape ( seq -- shape )
    ! Compute the new second-to-last dimension
    seq first dims 2 - :> vdim
    seq 0 [ shape>> vdim swap nth + ] reduce
    ! Combine it to create the new shape
    seq first shape>> clone :> new-shape
    vdim new-shape set-nth


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

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