mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[BE]: ruff FURB136: replace ternary with min/max (preview) (#114382)
Replaces ternary if else statements with simple min max when appropriate. Pull Request resolved: https://github.com/pytorch/pytorch/pull/114382 Approved by: https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
88a8a0daa4
commit
ea7d70aecc
@ -37,7 +37,7 @@ if IS_ROCM and not IS_MEM_LEAK_CHECK:
|
||||
count += 1
|
||||
assert count > 0 # there must be at least 1 GPU
|
||||
# Limiting to 8 GPUs(PROCS)
|
||||
NUM_PROCS = 8 if count > 8 else count
|
||||
NUM_PROCS = min(count, 8)
|
||||
except subprocess.CalledProcessError as e:
|
||||
# The safe default for ROCm GHA runners is to run tests serially.
|
||||
NUM_PROCS = 1
|
||||
|
Reference in New Issue
Block a user