[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
bfac7c1015
commit
a288ff208c
1 changed files with 3 additions and 0 deletions
|
|
@ -1100,11 +1100,13 @@ def run_training_process(
|
|||
}
|
||||
try:
|
||||
import torch.distributed as _td
|
||||
|
||||
for _name, _stub in _td_stubs.items():
|
||||
if not hasattr(_td, _name):
|
||||
setattr(_td, _name, _stub)
|
||||
except Exception:
|
||||
import types
|
||||
|
||||
_td_mock = types.ModuleType("torch.distributed")
|
||||
for _name, _stub in _td_stubs.items():
|
||||
setattr(_td_mock, _name, _stub)
|
||||
|
|
@ -1115,6 +1117,7 @@ def run_training_process(
|
|||
)
|
||||
try:
|
||||
import torch as _torch
|
||||
|
||||
_torch.distributed = _td_mock
|
||||
except Exception:
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue