I think you could use a
Queue
(in your case,
torch.multiprocessing.Queue
) which is shared between a "loader"
Process
and a "trainer"
Process
. Have the "loader" load minibatches from files, maybe using a
for
loop, and once each one is loaded, push it to the
Queue
.