Commit 8a99d2e
committed
Add more statement reflection to start looking at assignment statements
And update build and version number.
This test case:
test: @autodiff @print type = {
// A simple first function would be:
// func: (a: double, b: double) -> double = { return a + b; }
func: (a: double, b: double) -> (r: double) = { r = a + b; }
// The generated autodiff forward transformation would be:
// func_diff: (a: double, a_d: double, b: double, b_d: double) -> (r: double, r_d: double) = {
// r_d = a * b_d + b * a_d;
// r = a * b;
// }
}
Now generates this output, recognizing that the statement is an assignment, and that the left-hand side of the assignment is a parameter or return name (but not yet manipulating the right-hand expression):
test:/* @autodiff @print */ type =
{
func:(
in a: double,
in b: double,
) -> (out r: double, ) =
{
r = a + b;
return;
}
func_diff:(
in a: double,
in a_d: double,
in b: double,
in b_d: double,
) -> (
out r: double = 1,
out r_d: double = 1,
) =
{
r_d = TODO_computed_derivative_expression;
r = TODO_changed_original_expression;
return;
}
}1 parent 62e7cf9 commit 8a99d2e
File tree
5 files changed
+1189
-632
lines changed- source
5 files changed
+1189
-632
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2752 | 2752 | | |
2753 | 2753 | | |
2754 | 2754 | | |
| 2755 | + | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
| 2770 | + | |
| 2771 | + | |
| 2772 | + | |
| 2773 | + | |
| 2774 | + | |
| 2775 | + | |
| 2776 | + | |
2755 | 2777 | | |
2756 | 2778 | | |
2757 | 2779 | | |
| |||
3294 | 3316 | | |
3295 | 3317 | | |
3296 | 3318 | | |
| 3319 | + | |
| 3320 | + | |
| 3321 | + | |
| 3322 | + | |
| 3323 | + | |
| 3324 | + | |
| 3325 | + | |
| 3326 | + | |
| 3327 | + | |
| 3328 | + | |
| 3329 | + | |
| 3330 | + | |
| 3331 | + | |
| 3332 | + | |
| 3333 | + | |
| 3334 | + | |
| 3335 | + | |
| 3336 | + | |
3297 | 3337 | | |
3298 | 3338 | | |
3299 | 3339 | | |
| |||
0 commit comments