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
138 stars 12 forks source link

Simplified PLKSR #255

Closed RunDevelopment closed 4 months ago

RunDevelopment commented 4 months ago

I wanted to make review comments, but there was a lot of small things, so I just quickly did them myself.

In general, I made the code less defensive. You almost always checked whether a key was present in the state dict before accessing it. This is entirely unnecessary, because we assume that the state dicts load gets are valid. So they aren't missing any important keys. If they were missing any such keys, then they'd be invalid and we'd be allowed to just fail. Using this assumption, I simplified some code.

Other changes: