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

Method forward

ram/utils/diffjpeg.py:310–321  ·  view source on GitHub ↗

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

(self, image)

Source from the content-addressed store, hash-verified

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
324class BlockMerging(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected