ufv_apply_variations_masks#

t3toolbox.backend.ufv_masking.ufv_apply_variations_masks(data)#
def ufv_apply_variations_masks(
        data: typ.Tuple[
            NDArray,             # tucker_variations_supercore, (d,)+stack_shape+(nD, N)
            NDArray,             # tt_variations_supercore,     (d,)+stack_shape+(rL, nU, rR)
            typ.Sequence[int],   # shape = (N0,...,N(d-1)), static int tuple
            typ.Tuple[
                NDArray,  # variations_up_mask,    dtype=bool, (d,)+stack_shape+(nU,)
                NDArray,  # variations_down_mask,  dtype=bool, (d,)+stack_shape+(nD,)
                NDArray,  # variations_left_mask,  dtype=bool, (d,)+stack_shape+(rL,)
                NDArray,  # variations_right_mask, dtype=bool, (d,)+stack_shape+(rR,)
            ],
        ],
) -> typ.Tuple[
    NDArray,  # masked_tucker_variations_supercore
    NDArray,  # masked_tt_variations_supercore
]:

Zero the padded (“garbage”) regions of the variation supercores via the edge masks. shape_mask is reconstructed on the host from the static shape ints (np, never jnp).

Parameters:

data (t3toolbox.backend.common.typ.Tuple[NDArray, NDArray, t3toolbox.backend.common.typ.Sequence[int], t3toolbox.backend.common.typ.Tuple[NDArray, NDArray, NDArray, NDArray]])

Return type:

t3toolbox.backend.common.typ.Tuple[NDArray, NDArray]