code: def test_torch_seed(self):
      # test that using util.torch_seed doesn't impact the generation of
      # random numbers outside its context and that random numbers generated
      # within its context are the same as setting a manual seed
      torch.manual_seed(0)
      torch.randn(10)
      random_tensor_1 = torch.randn(10)
      torch.manual_seed(0)
      torch.randn(10)
      with util.torch_seed(1):
          random_tensor_2 = torch.randn(10)
      self.assertTrue(torch.equal(torch.randn(10), random_tensor_1))
      torch.manual_seed(1)
      self.assertTrue(torch.equal(torch.randn(10), random_tensor_2))
  
imports: import copy
  import shutil
  import tempfile
  import unittest
  import unittest.mock
  from pathlib import Path
  import classy_vision.generic.util
  import torch
  import torch.nn
  from classy_vision.generic.util import CHECKPOINT_FILE, get_torch_version, load_checkpoint, save_checkpoint, split_batchnorm_params, Timer, update_classy_model, update_classy_state
  from classy_vision.models import build_model
  from classy_vision.tasks import build_task
  from classy_vision.trainer import LocalTrainer
  from test.generic.config_utils import get_fast_test_task_config, get_test_model_configs
  from test.generic.utils import compare_model_state, compare_states
label_desc: Use image node_id 4 for calling the TestUtilMethods obj's underlying member method code with example usage: obj.test_torch_seed() without return types