[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:
Aaron Gokaslan
2023-11-22 22:09:57 +00:00
committed by PyTorch MergeBot
parent 88a8a0daa4
commit ea7d70aecc
4 changed files with 4 additions and 4 deletions

View File

@ -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