diff --git a/examples/model_selection/Trails/internal/ml/model_selection/src/eva_engine/phase1/algo/singa_ms/cnn_ms/pkg_model_code/model.py b/examples/model_selection/Trails/internal/ml/model_selection/src/eva_engine/phase1/algo/singa_ms/cnn_ms/pkg_model_code/model.py index 98884584f..1d54e41e2 100644 --- a/examples/model_selection/Trails/internal/ml/model_selection/src/eva_engine/phase1/algo/singa_ms/cnn_ms/pkg_model_code/model.py +++ b/examples/model_selection/Trails/internal/ml/model_selection/src/eva_engine/phase1/algo/singa_ms/cnn_ms/pkg_model_code/model.py @@ -27,7 +27,7 @@ import zipfile import numpy as np from functools import wraps -from collections import Iterable +from collections.abc import Iterable from singa import tensor from singa import autograd diff --git a/python/singa/model.py b/python/singa/model.py index 5f1ed2c21..ebfd36817 100644 --- a/python/singa/model.py +++ b/python/singa/model.py @@ -27,7 +27,7 @@ import zipfile import numpy as np from functools import wraps -from collections import Iterable +from collections.abc import Iterable from singa import tensor from singa import autograd diff --git a/python/singa/sonnx.py b/python/singa/sonnx.py index 01d704a38..324451231 100755 --- a/python/singa/sonnx.py +++ b/python/singa/sonnx.py @@ -900,7 +900,7 @@ def singa_op_to_onnx_node(cls, op, op_t): else: translator = cls._common_singa_tensor_to_onnx_node nodes = translator(op, op_t) - if not isinstance(nodes, collections.Iterable): + if not isinstance(nodes, collections.abc.Iterable): nodes = [nodes] nodes = [node for node in nodes if node is not None] return nodes @@ -1826,7 +1826,7 @@ def _run_node(cls, operator, inputs): list, the output """ outputs = operator(*inputs) - if not isinstance(outputs, collections.Iterable): + if not isinstance(outputs, collections.abc.Iterable): outputs = [outputs] return outputs @@ -2226,4 +2226,4 @@ def forward(self, *input, aux_output=(), **kwargs): get_op = SingaBackend._onnx_node_to_singa_op to_onnx = SingaFrontend.singa_to_onnx_model save = onnx.save -load = onnx.load \ No newline at end of file +load = onnx.load