Skip to content

Commit 30efd0c

Browse files
MGAMZCopilot
authored andcommitted
Fix logical error and improve readability
Co-authored-by: Copilot <[email protected]>
1 parent 0791bda commit 30efd0c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mmengine/_strategy/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ def compile_model(
322322
Returns:
323323
nn.Module: Compiled model.
324324
"""
325-
if isinstance(compile, bool) and not compile or \
326-
isinstance(compile, dict) and not compile.get('disable', False):
325+
if (isinstance(compile, bool) and not compile) or \
326+
(isinstance(compile, dict) and compile.get('disable', False)):
327327
return model
328328

329329
assert digit_version(TORCH_VERSION) >= digit_version('2.0.0'), (

0 commit comments

Comments
 (0)