MCPcopy Create free account
hub / github.com/DragonisCV/RAM / forward

Method forward

ram/utils/diffjpeg.py:255–269  ·  view source on GitHub ↗

Args: image(tensor): batch x height x width Returns: Tensor: batch x height x width

(self, image, factor=1)

Source from the content-addressed store, hash-verified

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
272class CDequantize(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected