From bef5926fd5ce874530ccbbfb609ab484e08f64e3 Mon Sep 17 00:00:00 2001 From: felix Date: Wed, 11 Oct 2023 16:08:41 +0200 Subject: [PATCH] fix mypy --- doctr/models/modules/transformer/pytorch.py | 2 +- doctr/models/recognition/crnn/pytorch.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doctr/models/modules/transformer/pytorch.py b/doctr/models/modules/transformer/pytorch.py index 63ad346c2..190a12da6 100644 --- a/doctr/models/modules/transformer/pytorch.py +++ b/doctr/models/modules/transformer/pytorch.py @@ -37,7 +37,7 @@ def forward(self, x: torch.Tensor) -> torch.Tensor: Returns: positional embeddings (batch, max_len, d_model) """ - x = x + self.pe[:, : x.size(1)] # type: ignore + x = x + self.pe[:, : x.size(1)] return self.dropout(x) diff --git a/doctr/models/recognition/crnn/pytorch.py b/doctr/models/recognition/crnn/pytorch.py index b1e50f1ad..daf0e56e5 100644 --- a/doctr/models/recognition/crnn/pytorch.py +++ b/doctr/models/recognition/crnn/pytorch.py @@ -249,7 +249,7 @@ def _crnn( _cfg["input_shape"] = kwargs["input_shape"] # Build the model - model = CRNN(feat_extractor, cfg=_cfg, **kwargs) # type: ignore[arg-type] + model = CRNN(feat_extractor, cfg=_cfg, **kwargs) # Load pretrained parameters if pretrained: # The number of classes is not the same as the number of classes in the pretrained model =>