diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-09-05 00:05:17 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-09-05 00:05:17 +0200 |
commit | f95d51e45ea24a956ce4384e4680f849651b2506 (patch) | |
tree | 6be87d25826f1ce848de9d0d0e53c17dff023f14 /text_recognizer/networks/perceiver/perceiver.py | |
parent | 4b112d4164d4de103997c5ddcadb802ab6440c8d (diff) |
Remove mask from perceiver io
Diffstat (limited to 'text_recognizer/networks/perceiver/perceiver.py')
-rw-r--r-- | text_recognizer/networks/perceiver/perceiver.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/text_recognizer/networks/perceiver/perceiver.py b/text_recognizer/networks/perceiver/perceiver.py index d4bca0b..5b4ab26 100644 --- a/text_recognizer/networks/perceiver/perceiver.py +++ b/text_recognizer/networks/perceiver/perceiver.py @@ -69,15 +69,13 @@ class PerceiverIO(nn.Module): self.decoder_ff = PreNorm(queries_dim, FeedForward(queries_dim)) self.to_logits = nn.Linear(queries_dim, logits_dim) - def forward( - self, data: Tensor, queries: Tensor, mask: Optional[Tensor] = None - ) -> Tensor: + def forward(self, data: Tensor, queries: Tensor) -> Tensor: b = data.shape[0] x = repeat(self.latents, "n d -> b n d", b=b) cross_attn, cross_ff = self.cross_attn_block - x = cross_attn(x, context=data, mask=mask) + x + x = cross_attn(x, context=data) + x x = cross_ff(x) + x for attn, ff in self.layers: |