Creating 3D Dataset/DataLoader with patches

unfold should work. Have a look at this post for an example.