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

Method forward

mmseg/models/backbones/twins.py:338–348  ·  view source on GitHub ↗
(self, x, hw_shape)

Source from the content-addressed store, hash-verified

336 self.stride = stride
337
338 def forward(self, x, hw_shape):
339 b, n, c = x.shape
340 h, w = hw_shape
341 feat_token = x
342 cnn_feat = feat_token.transpose(1, 2).view(b, c, h, w)
343 if self.stride == 1:
344 x = self.proj(cnn_feat) + cnn_feat
345 else:
346 x = self.proj(cnn_feat)
347 x = x.flatten(2).transpose(1, 2)
348 return x
349
350
351@BACKBONES.register_module()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected