t3toolbox.OLD_uniform.ut3_to_t3 =============================== .. py:function:: t3toolbox.OLD_uniform.ut3_to_t3(cores: UniformTuckerTensorTrain, masks: UniformEdgeWeights, use_jax: bool = False) -> t3toolbox.tucker_tensor_train.TuckerTensorTrain Convert UniformTuckerTensorTrain to TuckerTensorTrain. .. rubric:: Examples >>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> import t3toolbox.uniform_tucker_tensor_train as ut3 >>> x = t3.t3_corewise_randn(((14,15,16), (4,6,5), (1,3,2,1))) >>> cores, masks = ut3.t3_to_ut3(x) # Convert t3 -> ut3 >>> print(ut3.get_uniform_structure(cores)) (3, 16, 6, 3) >>> print(ut3.get_original_structure(masks)) ((14, 15, 16), (4, 6, 5), (1, 3, 2, 1)) >>> x2 = ut3.ut3_to_t3(cores, masks) # Convert ut3 -> t3 >>> print(t3.get_structure(x2)) ((14, 15, 16), (4, 6, 5), (1, 3, 2, 1)) >>> print([np.linalg.norm(B - B2) for B, B2 in zip(x[0], x2[0])]) [0.0, 0.0, 0.0] >>> print([np.linalg.norm(G - G2) for G, G2 in zip(x[1], x2[1])]) [0.0, 0.0, 0.0]