title: How do I load multiple grayscale images as a single tensor in pytorch?
body: <p>I'm currently trying to use a stack a set of images as a single entity for each label to train a CNN on using cross-validation. Given a dataset of 224x224x1 grayscale images sorted by:</p>
  
  <pre><code>Root/
      Class0/image0_view0.png
      Class0/image0_view1.png
      Class0/image0_view2.png
      ...
      Class1/image0_view0.png
      Class1/image0_view1.png
      Class1/image0_view2.png
  </code></pre>
  
  <p>How would I go about flowing 3 images (view 0, 1, and 2) as a single tensor with dimensions 224x224x3 (3 grayscale images)? In other words, how would I create a dataset of image stacks in pytorch using ImageFolder/DatasetFolder and DataLoader? Would I have to re-organize my folders and classes, or would it be easier to make the stacks when I make the splits for cross-validation?</p>
  
  <p>Thank you for your time and help! Let me know if I can provide any more info.</p>