Skip to content

Commit c7b0e2a

Browse files
committed
mypy
1 parent 7b1f326 commit c7b0e2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

onnx_diagnostic/reference/torch_evaluator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def __init__(
5252
):
5353
self.providers = providers
5454
self.constants: Dict[str, torch.Tensor] = {}
55-
self.kernels: List[Optional[torch_ops.OpRun]] = []
55+
self.kernels: List[torch_ops.OpRun] = []
5656
self.CPU = torch.tensor([0]).to("cpu").device
5757
if "CUDAExecutionProvider" in providers:
5858
self.CUDA = torch.tensor([0]).to("cuda").device
@@ -117,7 +117,7 @@ def _build_initializers(self, inits: Sequence[Union[onnx.NodeProto, onnx.TensorP
117117

118118
def _build_kernels(self, nodes: Sequence[onnx.NodeProto]):
119119
kernels = get_kernels()
120-
self.kernels: List[torch_ops.OpRun] = []
120+
self.kernels.clear()
121121
for node in nodes:
122122
if node.op_type == "Constant" and node.domain == "":
123123
# Treated as a constant.

0 commit comments

Comments
 (0)