| 4 | |
| 5 | |
| 6 | class CenterCropResize(nn.Module): |
| 7 | def __init__(self, size): |
| 8 | super().__init__() |
| 9 | self.size = size |
| 10 | |
| 11 | def forward(self, x): |
| 12 | h, w = x.shape[-2:] |
| 13 | min_size = min(h, w) |
| 14 | crop = T.functional.center_crop(x, min_size) |
| 15 | x = T.functional.resize(crop, self.size, antialias=True) |
| 16 | return x |
| 17 | |
| 18 | |
| 19 | class RescaleDiffusersLatent: |
nothing calls this directly
no outgoing calls
no test coverage detected