Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Delete tests/test_demosaic.py
Browse files- tests/test_demosaic.py +0 -17
tests/test_demosaic.py
DELETED
|
@@ -1,17 +0,0 @@
|
|
| 1 |
-
from torch import rand
|
| 2 |
-
from torch.nn.init import uniform_
|
| 3 |
-
|
| 4 |
-
from synet.base import Conv2d
|
| 5 |
-
from synet.demosaic import reshape_conv
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def test_reshape_conv():
|
| 9 |
-
conv = Conv2d(3, 13, 3, 2)
|
| 10 |
-
for param in conv.parameters():
|
| 11 |
-
uniform_(param, -1)
|
| 12 |
-
reshaped_conv = reshape_conv(conv)
|
| 13 |
-
inp = rand(3, 480, 640)
|
| 14 |
-
reshaped_inp = inp.reshape(3, 240, 2, 320, 2
|
| 15 |
-
).permute(2, 4, 0, 1, 3
|
| 16 |
-
).reshape(12, 240, 320)
|
| 17 |
-
assert (reshaped_conv(reshaped_inp) - conv(inp)).abs().max() < 1e-5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|