(self, c)
| 670 | return self.scale_factor * z |
| 671 | |
| 672 | def get_learned_conditioning(self, c): |
| 673 | if self.cond_stage_forward is None: |
| 674 | if hasattr(self.cond_stage_model, 'encode') and callable(self.cond_stage_model.encode): |
| 675 | c = self.cond_stage_model.encode(c) |
| 676 | if isinstance(c, DiagonalGaussianDistribution): |
| 677 | c = c.mode() |
| 678 | else: |
| 679 | c = self.cond_stage_model(c) |
| 680 | else: |
| 681 | assert hasattr(self.cond_stage_model, self.cond_stage_forward) |
| 682 | c = getattr(self.cond_stage_model, self.cond_stage_forward)(c) |
| 683 | return c |
| 684 | |
| 685 | def meshgrid(self, h, w): |
| 686 | y = torch.arange(0, h).view(h, 1, 1).repeat(1, w, 1) |
no test coverage detected