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

Method forward

ram/utils/diffjpeg.py:134–145  ·  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

132 self.scale = nn.Parameter(torch.from_numpy(np.outer(alpha, alpha) * 0.25).float())
133
134 def forward(self, image):
135 """
136 Args:
137 image(tensor): batch x height x width
138
139 Returns:
140 Tensor: batch x height x width
141 """
142 image = image - 128
143 result = self.scale * torch.tensordot(image, self.tensor, dims=2)
144 result.view(image.shape)
145 return result
146
147
148class YQuantize(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected