-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved parameter detection for DAT (#35)
* Improved parameter detection for DAT * Review comments
- Loading branch information
1 parent
80ce019
commit 71fc7e2
Showing
3 changed files
with
89 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from spandrel.architectures.DAT import DAT, load | ||
|
||
from .util import assert_loads_correctly | ||
|
||
|
||
def test_DAT_load(): | ||
assert_loads_correctly( | ||
load, | ||
lambda: DAT(), | ||
lambda: DAT(embed_dim=60), | ||
lambda: DAT(in_chans=1), | ||
lambda: DAT(in_chans=4), | ||
lambda: DAT(depth=[2, 3], num_heads=[2, 5]), | ||
lambda: DAT(depth=[2, 3, 4, 2], num_heads=[2, 3, 2, 2]), | ||
lambda: DAT(depth=[2, 3, 4, 2, 5], num_heads=[2, 3, 2, 2, 3]), | ||
lambda: DAT(upsampler="pixelshuffle", upscale=1), | ||
lambda: DAT(upsampler="pixelshuffle", upscale=2), | ||
lambda: DAT(upsampler="pixelshuffle", upscale=3), | ||
lambda: DAT(upsampler="pixelshuffle", upscale=4), | ||
lambda: DAT(upsampler="pixelshuffle", upscale=8), | ||
lambda: DAT(upsampler="pixelshuffledirect", upscale=1), | ||
lambda: DAT(upsampler="pixelshuffledirect", upscale=2), | ||
lambda: DAT(upsampler="pixelshuffledirect", upscale=3), | ||
lambda: DAT(upsampler="pixelshuffledirect", upscale=4), | ||
lambda: DAT(upsampler="pixelshuffledirect", upscale=8), | ||
lambda: DAT(resi_connection="3conv"), | ||
lambda: DAT(qkv_bias=False), | ||
lambda: DAT(split_size=[4, 4]), | ||
lambda: DAT(split_size=[2, 8]), | ||
condition=lambda a, b: ( | ||
a.num_layers == b.num_layers | ||
and a.upscale == b.upscale | ||
and a.upsampler == b.upsampler | ||
and a.embed_dim == b.embed_dim | ||
and a.num_features == b.num_features | ||
), | ||
) |