I have a huge three-dimensional tensor that is stored in a file on my disk (which I usually read with np.load
). This is a binary .npy
file. When using np.load
I quickly use most of my memory.
Fortunately, every time I run the program, I only need a certain piece of the huge tensor. The slice has a fixed size and its dimensions are provided from the external module.
What is the best way to do this? The only way I could understand is to somehow save this numpy
matrix in a MySQL database. But I'm sure there are much better / simpler ways. I will also be happy to build my 3D tensor file differently if that helps.
Does the answer change if my tensor is sparse in nature?
source share