MCPcopy Create free account
hub / github.com/chenhaoxing/HDNet / forward

Method forward

models/drconv.py:39–48  ·  view source on GitHub ↗

group conv2d to calculate cross correlation

(self, x, kernel, groups, kwargs)

Source from the content-addressed store, hash-verified

37
38 @staticmethod
39 def forward(self, x, kernel, groups, kwargs):
40 """group conv2d to calculate cross correlation
41 """
42 batch = x.size(0)
43 channel = x.size(1)
44 x = x.view(1, -1, x.size(2), x.size(3))
45 kernel = kernel.view(-1, channel // groups, kernel.size(2), kernel.size(3))
46 out = F.conv2d(x, kernel, **kwargs, groups=groups * batch)
47 out = out.view(batch, -1, out.size(2), out.size(3))
48 return out
49
50class Correlation(nn.Module):
51 use_slow = True

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected