chaiNNer-org / spandrel

Spandrel gives your project support for various PyTorch architectures meant for AI Super-Resolution, restoration, and inpainting. Based on the model support implemented in chaiNNer.
MIT License
139 stars 12 forks source link

Allow device strings in `to` again #139

Closed RunDevelopment closed 8 months ago

RunDevelopment commented 8 months ago

PyTorch docs and types are wrong. See https://github.com/pytorch/pytorch/issues/117936. So #133 was misguided.

So I changed our API to allow str devices again. The if isinstance(device, str): device = torch.device(device) is only necessary to make the type checker happy.