Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PhrygianGates committed Aug 20, 2023
1 parent b162790 commit a6eff5f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/Differentiator/ReverseModeVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1707,13 +1707,17 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context,
pullback);

// Try to find it in builtin derivatives
pullbackCallArgs.insert(pullbackCallArgs.begin(), BuildOp(UnaryOperatorKind::UO_AddrOf, baseDiff.getExpr()));
if (baseDiff.getExpr()) {
pullbackCallArgs.insert(pullbackCallArgs.begin(), BuildOp(UnaryOperatorKind::UO_AddrOf, baseDiff.getExpr()));
}
std::string customPullback = clad::utils::ComputeEffectiveFnName(FD) + "_pullback";
OverloadedDerivedFn =
m_Builder.BuildCallToCustomDerivativeOrNumericalDiff(
customPullback, pullbackCallArgs, getCurrentScope(),
const_cast<DeclContext*>(FD->getDeclContext()));
pullbackCallArgs.erase(pullbackCallArgs.begin());
if (baseDiff.getExpr()) {
pullbackCallArgs.erase(pullbackCallArgs.begin());
}
}

// should be true if we are using numerical differentiation to differentiate
Expand Down

0 comments on commit a6eff5f

Please sign in to comment.