From 826c7bb38a759ec15e6e165ce39992653f666ffc Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Thu, 15 Oct 2020 22:04:14 +0200 Subject: [PATCH] Add example from issue #471 (shape prop) --- test/tom/Playground/Fusion.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/tom/Playground/Fusion.hs b/test/tom/Playground/Fusion.hs index 82ed6ae91..a1c4c1199 100644 --- a/test/tom/Playground/Fusion.hs +++ b/test/tom/Playground/Fusion.hs @@ -18,3 +18,12 @@ inputProgram = (zipWith (\x y -> T2 x y) (map (\x -> x) arr) (map (\x -> x) arr)) + +shapeTest :: Acc (Matrix Float) +shapeTest = + let a7 = use (fromList (Z :. (1 :: Int) :. (1 :: Int)) [5.0 :: Float]) + a8 = map (\x0 -> T2 (x0 * x0) x0) a7 + a9 = map (\(T2 x0 _) -> x0) a8 + in zipWith (+) + (generate (shape a9) (\_ -> 1.0)) + (map (\(T2 _ tup) -> tup) a8)