Skip to content

Commit

Permalink
Add example from issue AccelerateHS#471 (shape prop)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsmeding committed Oct 20, 2020
1 parent 345a651 commit 826c7bb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/tom/Playground/Fusion.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 826c7bb

Please sign in to comment.