Method
__init__
(self, mask, token_idx, scale_factor)
Source from the content-addressed store, hash-verified
| 19 | |
| 20 | class RASGAttnProcessor: |
| 21 | def __init__(self, mask, token_idx, scale_factor): |
| 22 | self.attention_scores = None # Stores the last output of the similarity matrix here. Each layer will get its own RASGAttnProcessor assigned |
| 23 | self.mask = mask |
| 24 | self.token_idx = token_idx |
| 25 | self.scale_factor = scale_factor |
| 26 | self.mask_resoltuion = mask.shape[-1] * mask.shape[-2] # 64 x 64 if the image is 512x512 |
| 27 | |
| 28 | def __call__( |
| 29 | self, |
Tested by
no test coverage detected