(self, x)
| 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 | |
| 328 | def count_flops_attn(model, _x, y): |
nothing calls this directly
no outgoing calls
no test coverage detected