code: def test_generator_seed(self) -> None:
      gen = torch.Generator()
      model1, optim1, dl1 = self._init_training(generator=gen)
      gen.manual_seed(8888)
      _epoch(model1, optim1, dl1)
  
      model2, optim2, dl2 = self._init_training(generator=gen)
      gen.manual_seed(8888)
      _epoch(model2, optim2, dl2)
      self.assertTrue(
          torch.allclose(model1._module.weight, model2._module.weight)
      )
  
imports: import unittest
  from typing import Optional
  import torch
  import torch.nn
  from opacus import PrivacyEngine
  from opacus.data_loader import DPDataLoader, switch_generator
  from opacus.grad_sample import GradSampleModule
  from opacus.optimizers import DPOptimizer
  from torch.utils.data import DataLoader, TensorDataset
label_desc: Use image node_id 8 for calling the OptimizerRandomnessTest obj's underlying member method code with example usage: obj.test_generator_seed() without return types