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

Method forward

ram/utils/diffjpeg.py:389–398  ·  view source on GitHub ↗

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

(self, image)

Source from the content-addressed store, hash-verified

387 self.matrix = nn.Parameter(torch.from_numpy(matrix))
388
389 def forward(self, image):
390 """
391 Args:
392 image(tensor): batch x height x width x 3
393
394 Returns:
395 Tensor: batch x 3 x height x width
396 """
397 result = torch.tensordot(image + self.shift, self.matrix, dims=1)
398 return result.view(image.shape).permute(0, 3, 1, 2)
399
400
401class DeCompressJpeg(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected