You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, it seems that the python interface for reading a vector/matrix in TT format from a file is missing but all the fortran subroutines are implemented. The write() interface is fine. Is it possible to read a vector written with the write() method?
Raffaele
The text was updated successfully, but these errors were encountered:
@rborrelli There is not any interface for serialization tt.tensor to and deserialization from file. The presence of fortran subroutines do not motivate serialization interface since fortran code compiled directly to shared object(or dynamic linked library on Windows) which is imported later. All this stuff allow invoke fortran subroutines from python code directly. Here is details how it works.
In despite that there is not built-in ability to (de)serialize TT-formated tensor one can use to_list and from_list static methods in following way.
importnumpyasnpimportttA=tt.tensor(...) # tensor objectnp.savez('tensor.npz', *B.to_list()) # store into tensor.npzB=tt.tensor.from_list(np.load('tensor.npz').items()) # load from tensor.npz
Hi, sorry, for waking up this pretty old message but the solution you suggested seems to have some problem.
The deserialization indeed gives me the following error:
File "/home/lello/anaconda3/lib/python3.7/site-packages/tt/core/vector.py", line 96, in from_list
cr = _np.concatenate((cr, a[i].flatten(order)))
TypeError: 'ItemsView' object is not subscriptable
Hi, it seems that the python interface for reading a vector/matrix in TT format from a file is missing but all the fortran subroutines are implemented. The write() interface is fine. Is it possible to read a vector written with the write() method?
Raffaele
The text was updated successfully, but these errors were encountered: