(self, attn, is_cross: bool, place_in_unet: str)
| 147 | raise NotImplementedError |
| 148 | |
| 149 | def __call__(self, attn, is_cross: bool, place_in_unet: str): |
| 150 | if self.cur_att_layer >= self.num_uncond_att_layers: |
| 151 | if LOW_RESOURCE: |
| 152 | attn = self.forward(attn, is_cross, place_in_unet) |
| 153 | else: |
| 154 | h = attn.shape[0] |
| 155 | attn[h // 2:] = self.forward(attn[h // 2:], is_cross, place_in_unet) |
| 156 | self.cur_att_layer += 1 |
| 157 | # print(self.num_att_layers) |
| 158 | # print(self.num_uncond_att_layers) |
| 159 | if self.cur_att_layer == self.num_att_layers + self.num_uncond_att_layers: |
| 160 | self.cur_att_layer = 0 |
| 161 | self.cur_step += 1 |
| 162 | # print(self.cur_step) |
| 163 | self.between_steps() |
| 164 | return attn |
| 165 | |
| 166 | def reset(self): |
| 167 | self.cur_step = 0 |
nothing calls this directly
no test coverage detected