MCPcopy Create free account
hub / github.com/csxmli2016/MARCONetPlusPlus / forward

Method forward

networks/prior_arch.py:185–196  ·  view source on GitHub ↗
(self, labels)

Source from the content-addressed store, hash-verified

183 self.size = size
184 self.TextEmbeddings = nn.Parameter(torch.randn(class_num, channel, 1, 1))
185 def forward(self, labels):
186 b, c = labels.size()
187
188 TestEmbs = []
189 for i in range(b):
190 EmbTmps = []
191 for j in range(c):
192 EmbTmps.append(self.TextEmbeddings[labels[i][j]:labels[i][j]+1,...].repeat(1,1,self.size,self.size)) #
193 Seqs = torch.cat(EmbTmps, dim=3)
194 TestEmbs.append(Seqs)
195 OutEmbs = torch.cat(TestEmbs, dim=0)
196 return OutEmbs
197
198
199class StyledConv(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected