From f95d51e45ea24a956ce4384e4680f849651b2506 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 5 Sep 2022 00:05:17 +0200 Subject: Remove mask from perceiver io --- text_recognizer/networks/perceiver/perceiver.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'text_recognizer/networks/perceiver') 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: -- cgit v1.2.3-70-g09d2