ufv_stack_axes#

t3toolbox.backend.ufv_operations.ufv_stack_axes(xx, n_supercores, axes_start)#
def ufv_stack_axes(
        xx,                       # nested tuple (shaped like the stacked sub-run) of bv .data leaves
        n_supercores: int,        # 4 (frame) or 2 (variations)
        axes_start:   int,        # array axis the OUTERMOST new stack level lands on (others follow contiguously)
) -> typ.Tuple:                   # one stacked bv .data tuple (*supercores, shape, masks)

Stack an array-like tree of bv .data leaves onto a CONTIGUOUS run of array axes starting at axes_start. Inverse of ufv_unstack_axes().

Generalizes ufv_stack() (which stacks onto axes 1 ..) so the tangent layer can slot a new stack run at the right place – e.g. the frame stack C after an existing tangent stack K (at axes_start = 1 + |K|), keeping C inner. shape is read once (shared) and supercores/masks are stacked in SEPARATE stacking.stack() calls so the host-numpy masks are not promoted to jax.

Parameters:
  • n_supercores (int)

  • axes_start (int)

Return type:

t3toolbox.backend.common.typ.Tuple