MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / _forward

Method _forward

ldm/modules/diffusionmodules/openaimodel.py:319–325  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

317 #return pt_checkpoint(self._forward, x) # pytorch
318
319 def _forward(self, x):
320 b, c, *spatial = x.shape
321 x = x.reshape(b, c, -1)
322 qkv = self.qkv(self.norm(x))
323 h = self.attention(qkv)
324 h = self.proj_out(h)
325 return (x + h).reshape(b, c, *spatial)
326
327
328def count_flops_attn(model, _x, y):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected