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

Verify dtype in `to` #135

Closed RunDevelopment closed 8 months ago

RunDevelopment commented 8 months ago

model.to will now throw a UnsupportedDtypeError if the given dtype is not supported. Parsing overloads in a nightmare btw.

Since PyTorch has no API for parsing dtype strings, I had to remove str from the allowed types for dtype. As I outlined in discord, this isn't necessarily a bad thing.