Code refactor https://ultralytics.com/actions (#13844)
This commit is contained in:
parent
ffb46fd7fb
commit
ecfcdf12c9
13 changed files with 21 additions and 18 deletions
|
|
@ -693,7 +693,7 @@ class Ensemble(nn.ModuleList):
|
|||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def temporary_modules(modules={}, attributes={}):
|
||||
def temporary_modules(modules=None, attributes=None):
|
||||
"""
|
||||
Context manager for temporarily adding or modifying modules in Python's module cache (`sys.modules`).
|
||||
|
||||
|
|
@ -718,6 +718,10 @@ def temporary_modules(modules={}, attributes={}):
|
|||
applications or libraries. Use this function with caution.
|
||||
"""
|
||||
|
||||
if modules is None:
|
||||
modules = {}
|
||||
if attributes is None:
|
||||
attributes = {}
|
||||
import sys
|
||||
from importlib import import_module
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue