class_docstr: ### Dataset to load images
class_docstr_tok: ["#","#","#","Dataset","to","load","images"]
code: def __getitem__(self, index):
      # Return a pair of images.
      # These pairs get batched together, and they do not act like pairs in training.
      # So it is kind of ok that we always keep giving the same pair.
      return {
          "x": self.transform(
              load_image(self.files_a[index % len(self.files_a)])
          ),
          "y": self.transform(
              load_image(self.files_b[index % len(self.files_b)])
          ),
      }
  
imports: import itertools
  import random
  import zipfile
  from typing import Tuple
  import torch
  import torch.nn
  import torchvision.transforms
  from PIL import Image
  from torch.utils.data import DataLoader, Dataset
  from torchvision.transforms import InterpolationMode
  from torchvision.utils import make_grid
  from labml import lab, tracker, experiment, monit
  from labml.configs import BaseConfigs
  from labml.utils.download import download_file
  from labml.utils.pytorch import get_modules
  from labml_helpers.device import DeviceConfigs
  from labml_helpers.module import Module
label_desc: Use image node_id 3 for calling the ImageDataset obj's underlying member method code with example usage: obj.__getitem__(index) and returns: dict