MCPcopy Create free account
hub / github.com/awslabs/gap-text2sql / restore

Method restore

rat-sql-gap/seq2struct/utils/random_state.py:18–23  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

16 ]
17
18 def restore(self):
19 random.setstate(self.random_mod_state)
20 np.random.set_state(self.np_state)
21 torch.set_rng_state(self.torch_cpu_state)
22 for d, state in enumerate(self.torch_gpu_states):
23 torch.cuda.set_rng_state(state, d)
24
25
26class RandomContext:

Callers 3

__init__Method · 0.95
__enter__Method · 0.45
__exit__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected