MCPcopy Create free account
hub / github.com/PythonOT/POT / seed

Method seed

ot/backend.py:2219–2231  ·  view source on GitHub ↗
(self, seed=None)

Source from the content-addressed store, hash-verified

2217 return torch.reshape(a, shape)
2218
2219 def seed(self, seed=None):
2220 if seed is None:
2221 pass
2222 elif isinstance(seed, int):
2223 self.rng_.manual_seed(seed)
2224 self.rng_cuda_.manual_seed(seed)
2225 elif isinstance(seed, torch.Generator):
2226 if self.device_type(seed) == "GPU":
2227 self.rng_cuda_ = seed
2228 else:
2229 self.rng_ = seed
2230 else:
2231 raise ValueError("Non compatible seed : {}".format(seed))
2232
2233 def rand(self, *size, type_as=None):
2234 if type_as is not None:

Callers

nothing calls this directly

Calls 1

device_typeMethod · 0.95

Tested by

no test coverage detected