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

Class Corr

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

Source from the content-addressed store, hash-verified

31 return po
32
33class Corr(Function):
34 @staticmethod
35 def symbolic(g, x, kernel, groups):
36 return g.op("Corr", x, kernel, groups_i=groups)
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