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

Method forward

mmseg/models/backbones/mit.py:280–290  ·  view source on GitHub ↗
(self, x, hw_shape)

Source from the content-addressed store, hash-verified

278 self.with_cp = with_cp
279
280 def forward(self, x, hw_shape):
281 def _inner_forward(x):
282 x = self.attn(self.norm1(x), hw_shape, identity=x)
283 x = self.ffn(self.norm2(x), hw_shape, identity=x)
284 return x
285
286 if self.with_cp and x.requires_grad:
287 x = cp.checkpoint(_inner_forward, x)
288 else:
289 x = _inner_forward(x)
290 return x
291
292
293@BACKBONES.register_module()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected