class_docstr: Test dataset for validating registry functions
class_docstr_tok: ["Test","dataset","for","validating","registry","functions"]
code: def __init__(
      self,
      samples,
      batchsize_per_replica=1,
      num_samples=None,
      shuffle=False,
      transform=None,
  ):
      input_tensors = [sample["input"] for sample in samples]
      target_tensors = [sample["target"] for sample in samples]
      dataset = ListDataset(
          input_tensors, target_tensors, loader=lambda x: x
      )
      super().__init__(
          dataset=dataset,
          batchsize_per_replica=batchsize_per_replica,
          shuffle=shuffle,
          transform=transform,
          num_samples=len(samples)
          if num_samples is None
          else num_samples,
      )
  
imports: import multiprocessing
  import unittest
  import unittest.mock
  import classy_vision.dataset.classy_dataset
  import torch
  from classy_vision.dataset import build_dataset, register_dataset
  from classy_vision.dataset.core import ListDataset
  from test.generic.utils import compare_batches, compare_samples
  from torch.utils.data import DataLoader
label_desc: Use image node_id 1 to create a new TestDataset object from inherited base classes: classy_dataset with example: obj = TestDataset(samples, batchsize_per_replica, num_samples, shuffle, transform)