(self, x)
| 1309 | |
| 1310 | @torch.no_grad() |
| 1311 | def to_rgb(self, x): |
| 1312 | x = x.float() |
| 1313 | if not hasattr(self, "colorize"): |
| 1314 | self.colorize = torch.randn(3, x.shape[1], 1, 1).to(x) |
| 1315 | x = nn.functional.conv2d(x, weight=self.colorize) |
| 1316 | x = 2. * (x - x.min()) / (x.max() - x.min()) - 1. |
| 1317 | return x |
| 1318 | |
| 1319 | |
| 1320 | class DiffusionWrapper(pl.LightningModule): |
no outgoing calls
no test coverage detected