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

Method randn

ot/backend.py:2247–2259  ·  view source on GitHub ↗
(self, *size, type_as=None)

Source from the content-addressed store, hash-verified

2245 return torch.rand(size=size, generator=self.rng_)
2246
2247 def randn(self, *size, type_as=None):
2248 if type_as is not None:
2249 generator = (
2250 self.rng_cuda_ if self.device_type(type_as) == "GPU" else self.rng_
2251 )
2252 return torch.randn(
2253 size=size,
2254 dtype=type_as.dtype,
2255 generator=generator,
2256 device=type_as.device,
2257 )
2258 else:
2259 return torch.randn(size=size, generator=self.rng_)
2260
2261 def randperm(self, size, type_as=None):
2262 if not isinstance(size, int):

Callers

nothing calls this directly

Calls 2

device_typeMethod · 0.95
randnMethod · 0.45

Tested by

no test coverage detected