Skip to content

Commit 5d87c3b

Browse files
committed
mypy
1 parent 57653d5 commit 5d87c3b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

onnx_diagnostic/reference/torch_evaluator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def _build_kernels(self, nodes: Sequence[onnx.NodeProto]):
135135

136136
def run(
137137
self, outputs: Optional[List[str]], feeds: Dict[str, torch.Tensor]
138-
) -> List[torch.Tensor]:
138+
) -> List[Optional[torch.Tensor]]:
139139
"""
140140
Runs the ONNX model.
141141
@@ -182,12 +182,12 @@ def run(
182182
self.runtime_info[name].clean_value()
183183

184184
# outputs
185-
res = [self.runtime_info[o].value.tensor for o in outputs]
185+
res = [self.runtime_info[o].value.tensor for o in outputs] # type: ignore[assignment, union-attr]
186186

187187
# clean previous execution
188188
for k in feeds:
189189
self.runtime_info[k].clean_value()
190190
for o in outputs:
191191
self.runtime_info[o].clean_value()
192192

193-
return res
193+
return res # type: ignore[return-value]

0 commit comments

Comments
 (0)