Args: image(tensor): batch x height x width x 3 Returns: Tensor: batch x 3 x height x width
(self, image)
| 387 | self.matrix = nn.Parameter(torch.from_numpy(matrix)) |
| 388 | |
| 389 | def forward(self, image): |
| 390 | """ |
| 391 | Args: |
| 392 | image(tensor): batch x height x width x 3 |
| 393 | |
| 394 | Returns: |
| 395 | Tensor: batch x 3 x height x width |
| 396 | """ |
| 397 | result = torch.tensordot(image + self.shift, self.matrix, dims=1) |
| 398 | return result.view(image.shape).permute(0, 3, 1, 2) |
| 399 | |
| 400 | |
| 401 | class DeCompressJpeg(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected