t3_weights_consistent#

t3toolbox.backend.t3_operations.t3_weights_consistent(x0, weights)#
def t3_weights_consistent(
        x0:      typ.Tuple[typ.Sequence[NDArray], typ.Sequence[NDArray]],  # (tucker_cores, tt_cores)
        weights: typ.Tuple[typ.Sequence[NDArray], typ.Sequence[NDArray]],  # (tucker_weights, tt_weights)
) -> bool:                                                                 # True iff shape-consistent

True iff the weight tuple’s lengths, per-edge ranks, and stack_shape match the T3 x0 (a non-raising structural shape predicate).

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

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

Return type:

bool