(self, x: torch.Tensor, resized_size, unsharp=True)
| 421 | return sharpened |
| 422 | |
| 423 | def interpolate(self, x: torch.Tensor, resized_size, unsharp=True): |
| 424 | org_dtype = x.dtype |
| 425 | if org_dtype == torch.bfloat16: |
| 426 | x = x.float() |
| 427 | |
| 428 | x = torch.nn.functional.interpolate(x, size=resized_size, mode="bicubic", align_corners=False).to(dtype=org_dtype) |
| 429 | |
| 430 | # apply unsharp mask / アンシャープマスクを適用する |
| 431 | if unsharp and self.gaussian_blur_ksize: |
| 432 | x = self.apply_unshark_mask(x) |
| 433 | |
| 434 | return x |
| 435 | |
| 436 | |
| 437 | class EulerAncestralDiscreteSchedulerGL(EulerAncestralDiscreteScheduler): |
no test coverage detected