>>> print(cp_tensor)
CPTensor(shape=(3, 4, 2), rank=2)
>>> cp_tensor[:2, :2]
CPTensor(shape=(2, 2, 2), rank=2)
>>> cp_tensor[2, 3, 1]
tensor(0.0250, grad_fn=<SumBackward0>)
Note how, above, indexing tracks gradients as well!
New BlockTT factorization, generalizes tt-matrices
python
>>> ftt = tltorch.TensorizedTensor.new((5, (2, 2, 2), (3, 3, 3)), rank=0.5, factorization='BlockTT')
>>> ftt
BlockTT, shape=[5, 8, 27], tensorized_shape=(5, (2, 2, 2), (3, 3, 3)), rank=[1, 20, 20, 1])
>>> ftt[2]
BlockTT, shape=[8, 27], tensorized_shape=[(2, 2, 2), (3, 3, 3)], rank=[1, 20, 20, 1])
>>> ftt[0, :2, :2]