class_docstr: Tests member functions of ClassyDataset. Note, NotImplemented
  functions are mocked in TestDataset class.
class_docstr_tok: ["Tests","member","functions","of","ClassyDataset",".","Note",",","NotImplemented","functions","are","mocked","in","TestDataset","class","."]
code: def test_shuffle_logic(self):
      # Simple samples to test shuffling, just a single value tensor
      # so we know how things were shuffled
      dummy_samples_10 = [
          {"input": torch.tensor([[0]]), "target": torch.tensor([0])},
          {"input": torch.tensor([[1]]), "target": torch.tensor([0])},
          {"input": torch.tensor([[2]]), "target": torch.tensor([0])},
          {"input": torch.tensor([[3]]), "target": torch.tensor([0])},
          {"input": torch.tensor([[4]]), "target": torch.tensor([0])},
          {"input": torch.tensor([[5]]), "target": torch.tensor([0])},
          {"input": torch.tensor([[6]]), "target": torch.tensor([0])},
          {"input": torch.tensor([[7]]), "target": torch.tensor([0])},
          {"input": torch.tensor([[8]]), "target": torch.tensor([0])},
          {"input": torch.tensor([[9]]), "target": torch.tensor([0])},
      ]
      dataset = TestDataset(dummy_samples_10, shuffle=True)
  
      def unpack_tensors(tensor_list):
          return [t["input"].item() for t in tensor_list]
  
      # Epoch 0
      iterator = dataset.iterator(num_workers=0, current_phase_id=0)
      it = iter(iterator)
      epoch_0_list = [sample for sample in it]
      epoch_0_list = unpack_tensors(epoch_0_list)
  
      # Epoch 1
      iterator = dataset.iterator(num_workers=0, current_phase_id=1)
      it = iter(iterator)
      epoch_1_list = [sample for sample in it]
      epoch_1_list = unpack_tensors(epoch_1_list)
  
      # Should be same length, should be shuffled, should be
      # different shuffles for each epoch
      self.assertEqual(len(epoch_0_list), len(epoch_1_list))
      self.assertTrue(epoch_0_list != [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
      self.assertTrue(epoch_0_list != epoch_1_list)
  
      # Test different shuffle seeds
      iterator = dataset.iterator(
          num_workers=0, current_phase_id=0, shuffle_seed=10
      )
      it = iter(iterator)
      epoch_0_seed_10_list = [sample for sample in it]
      epoch_0_seed_10_list = unpack_tensors(epoch_0_seed_10_list)
      self.assertTrue(epoch_0_seed_10_list != epoch_0_list)
  
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 11 for calling the TestClassyDataset obj's underlying member method code with example usage: obj.test_shuffle_logic() and returns: unknown