MCPcopy Create free account
hub / github.com/drinkingcoder/FlowFormer-Official / corr

Method corr

core/corr.py:52–59  ·  view source on GitHub ↗
(fmap1, fmap2)

Source from the content-addressed store, hash-verified

50
51 @staticmethod
52 def corr(fmap1, fmap2):
53 batch, dim, ht, wd = fmap1.shape
54 fmap1 = fmap1.view(batch, dim, ht*wd)
55 fmap2 = fmap2.view(batch, dim, ht*wd)
56
57 corr = torch.matmul(fmap1.transpose(1,2), fmap2)
58 corr = corr.view(batch, ht, wd, 1, ht, wd)
59 return corr / torch.sqrt(torch.tensor(dim).float())
60
61
62class AlternateCorrBlock:

Callers 1

__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected