hstack-guide ( seq -- guide )


Vocabulary
tensors.private

Inputs
seqan object


Outputs
guidean object


Definition


:: hstack-guide ( seq -- guide )
seq [ shape>> last ] map
:> last-dims 0 0 last-dims sum [0..b) [
drop
:> old-t-ind :> last-dims-i last-dims-i last-dims nth
old-t-ind -
[ last-dims-i 1 + 0 ] [ drop last-dims-i old-t-ind ]
if-zero 2dup [ dup last-dims nth ] dip 3array
[ 1 + ] dip
] map nip nip ;