summaryrefslogtreecommitdiff
path: root/text_recognizer/model/greedy_decoder.py
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2023-09-03 01:14:41 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2023-09-03 01:14:41 +0200
commit53cfc21cffa4e877ad0959170b47b690d2fdb40f (patch)
tree88eaabb75a5ca6fba3c43655ccb754a9f0c5d649 /text_recognizer/model/greedy_decoder.py
parentd020059f2f71fe7c25765dde9d535195c09ece01 (diff)
Update lit models
Diffstat (limited to 'text_recognizer/model/greedy_decoder.py')
-rw-r--r--text_recognizer/model/greedy_decoder.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/text_recognizer/model/greedy_decoder.py b/text_recognizer/model/greedy_decoder.py
index 2c4c16e..8d55a02 100644
--- a/text_recognizer/model/greedy_decoder.py
+++ b/text_recognizer/model/greedy_decoder.py
@@ -34,7 +34,7 @@ class GreedyDecoder:
for i in range(1, self.max_output_len):
tokens = indecies[:, :i] # (B, Sy)
logits = self.network.decode(tokens, img_features) # [ B, N, C ]
- indecies_ = torch.argmax(logits, dim=2) # [ B, N ]
+ indecies_ = logits.argmax(dim=2) # [ B, N ]
indecies[:, i] = indecies_[:, -1]
# Early stopping of prediction loop if token is end or padding token.