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

Method forward

ram/utils/diffjpeg.py:331–345  ·  view source on GitHub ↗

Args: patches(tensor) batch x height*width/64, height x width height(int) width(int) Returns: Tensor: batch x height x width

(self, patches, height, width)

Source from the content-addressed store, hash-verified

329 super(BlockMerging, self).__init__()
330
331 def forward(self, patches, height, width):
332 """
333 Args:
334 patches(tensor) batch x height*width/64, height x width
335 height(int)
336 width(int)
337
338 Returns:
339 Tensor: batch x height x width
340 """
341 k = 8
342 batch_size = patches.shape[0]
343 image_reshaped = patches.view(batch_size, height // k, width // k, k, k)
344 image_transposed = image_reshaped.permute(0, 1, 3, 2, 4)
345 return image_transposed.contiguous().view(batch_size, height, width)
346
347
348class ChromaUpsampling(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected