Does pytorch support the conversion between tensor and mat (matlab data)?

as title. because I am familiar with matlab and sometimes need to use matlab.
so I wonder that does pytorch support the conversion between tensor and mat (matlab data)?

Not directly, but you could load the MATLAB .mat with scipy.io.loadmat, get the matrices with the right key as numpy arrays, and transform them to tensors with torch.from_numpy().

if not .mat files but the matrix variable, does it need matlab engine at this case?

Do you mean directly from the RAM?

yes, it is. directly from ram

Ok, then I have no idea, sorry.
Maybe, it’s somehow possbile, but I haven’t heard of it yet.

thank you all the same.