Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collections.Iterable Update to support Python 3.10 #1165

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/singa/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions python/singa/sonnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
load = onnx.load
Loading