Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor cleanup and nitpicks #2

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions site/articles/auto-diff.md
Original file line number Diff line number Diff line change
@@ -384,15 +384,15 @@ public final class ForwardDifferentiation {
Value zero;

private ForwardDifferentiation(FuncOp fcm, Block.Parameter ind) {
int indI = f.body().entryBlock().parameters().indexOf(ind);
int indI = fcm.body().entryBlock().parameters().indexOf(ind);
if (indI == -1) {
throw new IllegalArgumentException("Independent argument not defined by function");
}
this.fcm = fcm;
this.ind = ind;

// Calculate the active set of dependent values for the independent value
this.activeSet = ActiveSet.activeSet(f, ind);
this.activeSet = ActiveSet.activeSet(fcm, ind);
// A mapping of input values to their (output) differentiated values
this.diffValueMapping = new HashMap<>();
}
@@ -423,7 +423,7 @@ FuncOp partialDiff() {

// Transform f to f' w.r.t ind
AtomicBoolean first = new AtomicBoolean(true);
FuncOp dfcm = f.transform(STR."d\{f.funcName()}_darg\{indI}",
FuncOp dfcm = fcm.transform(STR."d\{fcm.funcName()}_darg\{indI}",
(block, op) -> {
// Initialization
if (first.getAndSet(false)) {
@@ -913,4 +913,4 @@ We can observe in `block_5` the application of the product rule. Further we can
observe additional block arguments and parameters required to pass along the
differential of `o`, `d_o`. In `block_9` there is a branch with an additional
block argument appended, value `%21`, that becomes the next value of `d_o`
in `block_0`, parameter `%8`
in `block_0`, parameter `%8`