Args: image(tensor): batch x height x width Returns: Tensor: batch x height x width
(self, image)
| 308 | self.tensor = nn.Parameter(torch.from_numpy(tensor).float()) |
| 309 | |
| 310 | def forward(self, image): |
| 311 | """ |
| 312 | Args: |
| 313 | image(tensor): batch x height x width |
| 314 | |
| 315 | Returns: |
| 316 | Tensor: batch x height x width |
| 317 | """ |
| 318 | image = image * self.alpha |
| 319 | result = 0.25 * torch.tensordot(image, self.tensor, dims=2) + 128 |
| 320 | result.view(image.shape) |
| 321 | return result |
| 322 | |
| 323 | |
| 324 | class BlockMerging(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected