import unittest


class TestCase(unittest.TestCase):
    pass

import random
import unittest

import autograd.numpy as anp
import numpy as np
import tensorflow as tf
import torch


class TestCase(unittest.TestCase):
    @classmethod
    def testSetUp(cls):
        seed = 42
        random.seed(seed)
        anp.random.seed(seed)
        np.random.seed(seed)
        torch.manual_seed(seed)
        tf.random.set_seed(seed)

Fix random seed in unit tests
Fix random seed in unit tests

Signed-off-by: Niklas Koep <342d5290239d9c5264c8f98185afedb99596601a@gmail.com>

+ import random
  import unittest
+ 
+ import autograd.numpy as anp
+ import numpy as np
+ import tensorflow as tf
+ import torch
  
  
  class TestCase(unittest.TestCase):
-     pass
+     @classmethod
+     def testSetUp(cls):
+         seed = 42
+         random.seed(seed)
+         anp.random.seed(seed)
+         np.random.seed(seed)
+         torch.manual_seed(seed)
+         tf.random.set_seed(seed)
  
Fix random seed in unit tests
## Code Before:
import unittest


class TestCase(unittest.TestCase):
    pass

## Instruction:
Fix random seed in unit tests
## Code After:
import random
import unittest

import autograd.numpy as anp
import numpy as np
import tensorflow as tf
import torch


class TestCase(unittest.TestCase):
    @classmethod
    def testSetUp(cls):
        seed = 42
        random.seed(seed)
        anp.random.seed(seed)
        np.random.seed(seed)
        torch.manual_seed(seed)
        tf.random.set_seed(seed)
