code: def random_seed_torch(seed):
      cpu_rng_state = torch.get_rng_state()
      torch.manual_seed(seed)
  
      try:
          yield
      finally:
          torch.set_rng_state(cpu_rng_state)
  
file_path: torchdiffeq/tests/norm_tests.py
imports: import contextlib
  import unittest
  import torch
  import torchdiffeq
  from problems import DTYPES, DEVICES, ADAPTIVE_METHODS
label_desc: Use image node_id 1 for calling a global function with example usage: random_seed_torch(seed) without return types