MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / sample

Method sample

sat/vae_modules/regularizers.py:21–26  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

19 self.var = self.std = torch.zeros_like(self.mean).to(device=self.parameters.device)
20
21 def sample(self):
22 # x = self.mean + self.std * torch.randn(self.mean.shape).to(
23 # device=self.parameters.device
24 # )
25 x = self.mean + self.std * torch.randn_like(self.mean)
26 return x
27
28 def kl(self, other=None):
29 if self.deterministic:

Callers 1

forwardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected