I have an algorithm in MATLAB that uses “Cell-Datastructure” to store 1D column vectors of different lengths. Now, I want to code this in PyTorch. However, I did not find a way to use variable column length tensors for 2D matrices, as it seems like 2D PyTorch Tensors has to be strictly of “m x n” shape.
The only way that I can think of is using Python dictionaries, and holding various columns in each Dictionary entry.
My prime concern is of processing speed, as I would have lots of columns and python for loops are pretty slow when I apply them in this task. Is there a better way to do it without dictionaries and prefereably with PyTorch?