(self, diffusion_model, compile_model: bool = False, dtype: torch.dtype = torch.float32)
| 7 | |
| 8 | class IdentityWrapper(nn.Module): |
| 9 | def __init__(self, diffusion_model, compile_model: bool = False, dtype: torch.dtype = torch.float32): |
| 10 | super().__init__() |
| 11 | compile = ( |
| 12 | torch.compile |
| 13 | if (version.parse(torch.__version__) >= version.parse("2.0.0")) and compile_model |
| 14 | else lambda x: x |
| 15 | ) |
| 16 | self.diffusion_model = compile(diffusion_model) |
| 17 | self.dtype = dtype |
| 18 | |
| 19 | def forward(self, *args, **kwargs): |
| 20 | return self.diffusion_model(*args, **kwargs) |
nothing calls this directly
no outgoing calls
no test coverage detected