From eac4f664719d38b467a33a496282cc6c4519be15 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 19 Jun 2022 19:53:54 +0200 Subject: Remove support file --- text_recognizer/models/util.py | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 text_recognizer/models/util.py (limited to 'text_recognizer/models/util.py') 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 -- cgit v1.2.3-70-g09d2