diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-06-19 19:53:54 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-06-19 19:53:54 +0200 |
commit | eac4f664719d38b467a33a496282cc6c4519be15 (patch) | |
tree | 265f5fb272715d398ae9d547a51be2f907a05158 | |
parent | b22bd31b5df62b2d17bc060d35d73cfae95851af (diff) |
Remove support file
-rw-r--r-- | text_recognizer/models/util.py | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/text_recognizer/models/util.py b/text_recognizer/models/util.py deleted file mode 100644 index cc0df3c..0000000 --- a/text_recognizer/models/util.py +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Union - -from torch import Tensor - - -def first_element(x: Tensor, element: Union[int, float], dim: int = 1) -> Tensor: - nonz = x == element - ind = ((nonz.cumsum(dim) == 1) & nonz).max(dim).indices - ind[ind == 0] = x.shape[dim] - return ind |