Skip to content
Snippets Groups Projects
Commit cae9de91 authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Add simple test to super resolution

parent ac2b1266
Branches
No related tags found
No related merge requests found
...@@ -16,6 +16,7 @@ import sympy ...@@ -16,6 +16,7 @@ import sympy
import pystencils import pystencils
import pystencils_reco.transforms import pystencils_reco.transforms
from pystencils_reco import crazy
from pystencils_reco.filters import gauss_filter from pystencils_reco.filters import gauss_filter
from pystencils_reco.resampling import ( from pystencils_reco.resampling import (
downsample, resample, resample_to_shape, scale_transform, translate) downsample, resample, resample_to_shape, scale_transform, translate)
...@@ -39,6 +40,25 @@ def test_superresolution(): ...@@ -39,6 +40,25 @@ def test_superresolution():
pyconrad.show_everything() pyconrad.show_everything()
def test_torch_simple():
import pytest
pytest.importorskip("torch")
import torch
x, y = torch.zeros((20, 20)), torch.zeros((20, 20))
a = sympy.Symbol('a')
@crazy
def move(x, y, a):
return {
y.center: x.interpolated_access((pystencils.x_, pystencils.y_ + a))
}
kernel = move(x, y, a).compile()
pystencils.autodiff.show_code(kernel.ast)
def test_downsample(): def test_downsample():
shape = (20, 10) shape = (20, 10)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment