MCPcopy Create free account
hub / github.com/CompVis/diff2flow / _forward

Method _forward

diff2flow/models/unet/openaimodel.py:321–327  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected