-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support compilation of closures (#36)
* Add `make_tracer` case for closures * Add closure case in `traced_type` Also remove `make_tracer` case for closures because it can be treated by the struct case * Test on mock closure * Fix Julia codegen for traced closures * Replace vector comprehension for tuple * Skip condition in CI --------- Co-authored-by: Sergio Sánchez Ramírez <[email protected]>
- Loading branch information
Showing
3 changed files
with
66 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Reactant | ||
|
||
muler(x) = y -> x * y | ||
|
||
@testset "closure" begin | ||
x = Reactant.ConcreteRArray(ones(2, 2)) | ||
y = Reactant.ConcreteRArray(ones(2, 2)) | ||
|
||
f = muler(x) | ||
g = Reactant.compile(f, (y,)) | ||
|
||
@test g(y) ≈ x * y | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters