From cae9de9129604ceed48c94858d0c044ab243dd57 Mon Sep 17 00:00:00 2001 From: Stephan Seitz <stephan.seitz@fau.de> Date: Fri, 28 Feb 2020 15:10:17 +0100 Subject: [PATCH] Add simple test to super resolution --- tests/test_superresolution.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/test_superresolution.py b/tests/test_superresolution.py index a879abb..dc602d7 100644 --- a/tests/test_superresolution.py +++ b/tests/test_superresolution.py @@ -16,6 +16,7 @@ import sympy import pystencils import pystencils_reco.transforms +from pystencils_reco import crazy from pystencils_reco.filters import gauss_filter from pystencils_reco.resampling import ( downsample, resample, resample_to_shape, scale_transform, translate) @@ -39,6 +40,25 @@ def test_superresolution(): 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(): shape = (20, 10) -- GitLab