Wrapper nn.Module wrapper for pipe.decode() method
| 498 | } |
| 499 | |
| 500 | class VAEDecoder(nn.Module): |
| 501 | """ Wrapper nn.Module wrapper for pipe.decode() method |
| 502 | """ |
| 503 | |
| 504 | def __init__(self): |
| 505 | super().__init__() |
| 506 | self.post_quant_conv = pipe.vae.post_quant_conv.to(dtype=torch.float32) |
| 507 | self.decoder = pipe.vae.decoder.to(dtype=torch.float32) |
| 508 | |
| 509 | def forward(self, z): |
| 510 | return self.decoder(self.post_quant_conv(z)) |
| 511 | |
| 512 | baseline_decoder = VAEDecoder().eval() |
| 513 |
no outgoing calls
no test coverage detected