I have a problem instance class which take batch_size and data_property to randomly generate a number of batch_size problem instances based on the given data_property, as shown below:
class Problem(object):
  def __init__(self, batch_size, data_property):
    super(Problem, self).__init__()
    self.batch_size = batch_size
    self.fields_A = self.generate_A(batch_size, data_property)
    self.fields_B = self.generate_B(batch_size, data_property)

How can I make this class / adjust this class so it can be a Pytorch Dataset?
import torch

class ProblemDataset(torch.utils.data.Dataset):
  'Characterizes a dataset for PyTorch'
  def __init__(self, data_properties):
        'Initialization'
        self.data_properties = data_properties

  def __len__(self):
        # What to do here?

  def __getitem__(self, index):
        # What to do here?