MCPcopy Create free account
hub / github.com/VCIP-RGBD/DFormer / forward

Method forward

models/net_utils.py:131–139  ·  view source on GitHub ↗
(self, x1, x2)

Source from the content-addressed store, hash-verified

129 self.norm2 = norm_layer(dim)
130
131 def forward(self, x1, x2):
132 y1, u1 = self.act1(self.channel_proj1(x1)).chunk(2, dim=-1)
133 y2, u2 = self.act2(self.channel_proj2(x2)).chunk(2, dim=-1)
134 v1, v2 = self.cross_attn(u1, u2)
135 y1 = torch.cat((y1, v1), dim=-1)
136 y2 = torch.cat((y2, v2), dim=-1)
137 out_x1 = self.norm1(x1 + self.end_proj1(y1))
138 out_x2 = self.norm2(x2 + self.end_proj2(y2))
139 return out_x1, out_x2
140
141
142# Stage 2

Callers

nothing calls this directly

Calls 2

norm1Method · 0.45
norm2Method · 0.45

Tested by

no test coverage detected