Open Yukwah1214 opened 4 months ago
Actually, I don't know how to reshape a tt_matrix. tt_tensor is easy: split a core of required size if you can, otherwise merge original cores until you can. For tt_matrix, you need to permute dimensions in different ways depending on what you want (you can't even tell this from sizes alone).
In your example in particular, splitting out a 4 x 1 core from a 8 x 8 matrix can be understood in at least the following ways:
The current code works if both row and column sizes can be reorganized by the same sequence of splits and merges. For anything more general I don't see how to write it consistently.
When I was trying to use the function tt_reshape, I encountered the following problem: It works when the code is :
but if I change the size: tt_reshape(tt_eye(8),[4,4,4;1,1,1]') it went wrong.
and if I change the size to: tt_reshape(tt_eye(8),[4,1,4;1,4,1]') it worked again!
I wonder what is the reason and what should I pay attention to when reshaping a TT tensor/matrix? Maybe this is a simple question, but I really can't find the answer. Sincerely hope someone can help me answer