Skip to content

Commit 01cac8a

Browse files
committed
mypy
1 parent fbb1e97 commit 01cac8a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

onnx_diagnostic/api.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1+
from typing import Any
2+
3+
14
class TensorLike:
25
"""Mocks a tensor."""
6+
7+
@property
8+
def dtype(self) -> Any:
9+
"Must be overwritten."
10+
raise NotImplementedError("dtype must be overwritten.")
11+
12+
@property
13+
def shape(self) -> Any:
14+
"Must be overwritten."
15+
raise NotImplementedError("shape must be overwritten.")

onnx_diagnostic/reference/torch_ops/_op_run.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ def copy(self) -> "OpRunSequence":
159159
"Shallow copy."
160160
return self.__class__(self.sequence, dtype=self.dtype)
161161

162+
def string_type(self) -> str:
163+
"Returns a string which can be printed."
164+
return string_type(self.sequence, with_shape=True)
165+
162166

163167
class OpRun:
164168
"""

0 commit comments

Comments
 (0)