(self, img1, img2)
| 360 | self.window = create_window(window_size, self.channel) |
| 361 | |
| 362 | def forward(self, img1, img2): |
| 363 | (_, channel, _, _) = img1.size() |
| 364 | |
| 365 | if channel == self.channel and self.window.data.type() == img1.data.type(): |
| 366 | window = self.window |
| 367 | else: |
| 368 | window = create_window(self.window_size, channel) |
| 369 | |
| 370 | if img1.is_cuda: |
| 371 | window = window.cuda(img1.get_device()) |
| 372 | window = window.type_as(img1) |
| 373 | |
| 374 | self.window = window |
| 375 | self.channel = channel |
| 376 | |
| 377 | return _ssim(img1, img2, window, self.window_size, channel, self.size_average) |
| 378 | |
| 379 | |
| 380 | window = None |
nothing calls this directly
no test coverage detected