Skip to content

Commit c516d0d

Browse files
committed
mypy
1 parent 72c063a commit c516d0d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

onnx_diagnostic/helpers/fake_tensor_helper.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
from typing import Any, Dict, Optional, Set, Tuple
22

33

4-
_UNIQUE = set()
5-
6-
74
class FakeTensorContext:
85
"""Stores information used to reused same dimension for the same dimension names."""
96

@@ -33,7 +30,7 @@ def _first_primes(cls, n=1000):
3330

3431
return [i for i, prime in enumerate(sieve) if prime and i >= 13]
3532

36-
def _unique(self):
33+
def _unique(self) -> int:
3734
i = 0
3835
c = self._candidates[i]
3936
while c in self._unique_ or c in self._mapping_int:
@@ -220,7 +217,7 @@ def make_fake_with_dynamic_dimensions(self, x: Any, dynamic_shapes: Any) -> Any:
220217

221218
x = torch.empty(tuple(new_shape), dtype=x.dtype, device=x.device)
222219

223-
t = self.fake_reshape(x, dynamic_shapes)
220+
t = self.fake_reshape(x, dynamic_shapes) # type: ignore[arg-type]
224221
assert t.device == x.device, f"device mismatch {x.device} -> {t.device}"
225222
assert t.dtype == x.dtype, f"dtype mismatch {x.dtype} -> {t.dtype}"
226223
return t

0 commit comments

Comments
 (0)