fix(todo): drop the unreachable duplicate branch in init_generator

The third branch repeats `device.type == "cuda"`, so it can never run, and
it cannot be enabled by correcting the condition either: the Generator API
rejects MPS outright. The repo's other copy of this helper,
modules/hidiffusion/utils.py, has cpu/cuda/else and no third branch.
This commit is contained in:
Tai An
2026-09-05 21:22:27 -07:00
parent b434eb0c1b
commit 8b738636d0
-2
View File
@@ -29,8 +29,6 @@ def init_generator(device: torch.device, fallback: torch.Generator = None):
return torch.Generator(device="cpu").set_state(torch.get_rng_state())
elif device.type == "cuda":
return torch.Generator(device=device).set_state(torch.cuda.get_rng_state())
elif device.type == "cuda":
return torch.Generator(device=device).set_state(torch.mps.get_rng_state())
else:
if fallback is None:
return init_generator(torch.device("cpu"))