Skip to content

Commit 82d3a69

Browse files
committed
ignore IValue for mypy check, since cannot import it from torch._C
1 parent 070f4a9 commit 82d3a69

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

torch/onnx/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
from torch._six import string_classes
1818
from torch.jit import _unique_state_dict
1919
from torch.onnx import ONNX_ARCHIVE_MODEL_PROTO_NAME, ExportTypes, OperatorExportTypes, TrainingMode
20-
from torch._C import ListType, OptionalType, _propagate_and_assign_input_shapes, _check_onnx_proto, IValue
21-
from typing import Union, Tuple, List, Dict
20+
from torch._C import ListType, OptionalType, _propagate_and_assign_input_shapes, _check_onnx_proto
21+
from typing import Union, Tuple, List
2222

2323

2424
# the flag to tell the user whether it's in the middle of ONNX export or not
@@ -29,7 +29,8 @@ def is_in_onnx_export():
2929
global __IN_ONNX_EXPORT
3030
return __IN_ONNX_EXPORT
3131

32-
_params_dict: Dict[str, IValue] = {}
32+
# Skip check due to cannot import IValue from torch._C
33+
_params_dict = {} # type: ignore
3334

3435
@contextlib.contextmanager
3536
def select_model_mode_for_export(model, mode):

0 commit comments

Comments
 (0)