Solved by my3bikaht in post #2 
              
              
                You’re selecting 30 samples per plane from 128 planes, all samples at the same position per batch. Why not just use slices across planes?
With batch_num==2 you can iterate IMO, and also you can just flatten the 10x10 into 100 if 4 dims is hard to keep in mind.