Args: image(tensor): batch x height x width Returns: Tensor: batch x height x width
(self, image)
| 132 | self.scale = nn.Parameter(torch.from_numpy(np.outer(alpha, alpha) * 0.25).float()) |
| 133 | |
| 134 | def forward(self, image): |
| 135 | """ |
| 136 | Args: |
| 137 | image(tensor): batch x height x width |
| 138 | |
| 139 | Returns: |
| 140 | Tensor: batch x height x width |
| 141 | """ |
| 142 | image = image - 128 |
| 143 | result = self.scale * torch.tensordot(image, self.tensor, dims=2) |
| 144 | result.view(image.shape) |
| 145 | return result |
| 146 | |
| 147 | |
| 148 | class YQuantize(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected