[BE] Remove dependency on six and future (#94709)

Remove the Python 2 and 3 compatibility library [six](https://pypi.org/project/six) and [future](https://pypi.org/project/future) and `torch._six`. We only support Python 3.8+ now. It's time to retire them.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/94709
Approved by: https://github.com/malfet, https://github.com/Skylion007
This commit is contained in:
Xuehai Pan
2023-02-14 09:14:10 +00:00
committed by PyTorch MergeBot
parent 39511697d4
commit b005ec62b9
73 changed files with 108 additions and 195 deletions

View File

@ -959,7 +959,7 @@ def _create_jit_graph(
if isinstance(model, torch.jit.ScriptModule):
try:
graph = model.forward.graph
graph = model.forward.graph # type: ignore[attr-defined]
except AttributeError as e:
raise RuntimeError("'forward' method must be a script method") from e
_C._jit_pass_onnx_function_substitution(graph)