Args: image(tensor): batch x height x width Returns: Tensor: batch x height x width
(self, image, factor=1)
| 253 | self.y_table = y_table |
| 254 | |
| 255 | def forward(self, image, factor=1): |
| 256 | """ |
| 257 | Args: |
| 258 | image(tensor): batch x height x width |
| 259 | |
| 260 | Returns: |
| 261 | Tensor: batch x height x width |
| 262 | """ |
| 263 | if isinstance(factor, (int, float)): |
| 264 | out = image * (self.y_table * factor) |
| 265 | else: |
| 266 | b = factor.size(0) |
| 267 | table = self.y_table.expand(b, 1, 8, 8) * factor.view(b, 1, 1, 1) |
| 268 | out = image * table |
| 269 | return out |
| 270 | |
| 271 | |
| 272 | class CDequantize(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected