MCPcopy Create free account
hub / github.com/TencentARC/MotionCtrl / sample

Method sample

lvdm/distributions.py:35–40  ·  view source on GitHub ↗
(self, noise=None)

Source from the content-addressed store, hash-verified

33 self.var = self.std = torch.zeros_like(self.mean).to(device=self.parameters.device)
34
35 def sample(self, noise=None):
36 if noise is None:
37 noise = torch.randn(self.mean.shape)
38
39 x = self.mean + self.std * noise.to(device=self.parameters.device)
40 return x
41
42 def kl(self, other=None):
43 if self.deterministic:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected