(model, count)
| 266 | return self.to_out(out) |
| 267 | cross_att_count = 0 |
| 268 | def change_forward(model, count): |
| 269 | for layer in model.children(): |
| 270 | if type(layer) == CrossAttention: |
| 271 | bound_method = new_forward.__get__(layer, layer.__class__) |
| 272 | setattr(layer, 'forward', bound_method) |
| 273 | count += 1 |
| 274 | else: |
| 275 | count += change_forward(layer, 0) |
| 276 | return count |
| 277 | |
| 278 | cross_att_count += change_forward(self.model.diffusion_model, 0) |
| 279 |
nothing calls this directly
no outgoing calls
no test coverage detected