t3frameweights_to_ut3frameweights#

t3toolbox.backend.ufv_conversions.t3frameweights_to_ut3frameweights(weights, nU=None, nD=None, rL=None, rR=None)#
def t3frameweights_to_ut3frameweights(
        weights: typ.Tuple[
            typ.Sequence[NDArray],  # up_weights,    len=d, elm_shape=C+(nUi,)
            typ.Sequence[NDArray],  # down_weights,  len=d, elm_shape=C+(nDi,)
            typ.Sequence[NDArray],  # left_weights,  len=d, elm_shape=C+(rLi,)
            typ.Sequence[NDArray],  # right_weights, len=d, elm_shape=C+(rRi,)
        ],
        nU: int = None,             # padded up rank    (default max); pass to match the tangent's pad
        nD: int = None,             # padded down rank  (default max)
        rL: int = None,             # padded left rank  (default max)
        rR: int = None,             # padded right rank (default max)
) -> typ.Tuple[
    NDArray,  # up_weight_supercore,    (d,)+C+(nU,)
    NDArray,  # down_weight_supercore,  (d,)+C+(nD,)
    NDArray,  # left_weight_supercore,  (d,)+C+(rL,)
    NDArray,  # right_weight_supercore, (d,)+C+(rR,)
    typ.Tuple[NDArray, NDArray, NDArray, NDArray],  # the four edge masks, HOST bool, static
]:

Pack a ragged T3FrameWeights into uniform frame-weight supercores + masks (the .data layout).

The frame-weight twin of t3frame_to_ut3frame(), and simpler: each family is one vector per edge, so only the last axis is padded, and there is no physical shape (weights live on internal edges only). The C stack is carried through untouched – a frame weight is frame-like, so it never grows a K axis (docs/contributor/weighted_internals.md §8.5).

Pass nU/nD/rL/rR to match the padding of the tangent these weights will pair with (e.g. from frame.uniform_structure); the defaults pad tightly to the weights’ own max ranks.

Parameters:
  • weights (t3toolbox.backend.common.typ.Tuple[t3toolbox.backend.common.typ.Sequence[NDArray], t3toolbox.backend.common.typ.Sequence[NDArray], t3toolbox.backend.common.typ.Sequence[NDArray], t3toolbox.backend.common.typ.Sequence[NDArray]])

  • nU (int)

  • nD (int)

  • rL (int)

  • rR (int)

Return type:

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