ufv_unstack_axes#

t3toolbox.backend.ufv_operations.ufv_unstack_axes(data, n_supercores, axes)#
def ufv_unstack_axes(
        data:         typ.Tuple,        # (*supercores, shape, masks): n_supercores arrays, int-tuple, 4-tuple of masks
        n_supercores: int,              # 4 (frame) or 2 (variations)
        axes:         typ.Sequence[int],  # the array axes to peel into tree levels (a CONTIGUOUS run within the stack)
):  # -> nested tuple (shaped like the peeled axes) of bv .data leaves carrying the remaining stack

Unstack a bv .data tuple along the GIVEN array axes (a sub-run of the stack), leaving the rest.

Generalizes ufv_unstack() (which peels the whole stack) to a contiguous sub-run – the primitive the tangent layer needs to split a K + C variation stack into just its K part or just its C part. The supercores and all four rank masks slice along axes (they share those stack-axis positions; the masks’ leading d vs d+1 is irrelevant since only axes are touched); shape is shared and replicated onto every leaf.

Parameters:
  • data (t3toolbox.backend.common.typ.Tuple)

  • n_supercores (int)

  • axes (t3toolbox.backend.common.typ.Sequence[int])