(self, noise=None)
| 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: |
nothing calls this directly
no outgoing calls
no test coverage detected