You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#![feature(autodiff)]use std::autodiff::autodiff;#[autodiff(d_square,Reverse,Duplicated,Active)]fnsquare(x:&f64) -> f64{
x * x
}#[autodiff(d_square2,Reverse,Duplicated,Active)]fnsquare2(x:&f64) -> f64{
x * x
}fnmain(){let x = 3.0;letmut dx = 1.0;d_square(&x,&mut dx,1.0);d_square2(&x,&mut dx,1.0);}
I expected to see this happen: d_square and d_square2 should both compute the derivative of x*x, thus 2.0 * x. However, LLVM (or something earlier?) recognizes that square and square2 are identical, and fuses them (ReplaceAllUsesWith, or RAUW for LLVM). autodiff then is missing a (source) function to differentiate, giving the following error. This is often happening in our test cases, where we just test the same dummy functions in a lot of different configurations.
Instead, this happened:
error: failed to prepare autodiff: src: _ZN2ad7square217h920417192f1e5f52E, target: _ZN2ad9d_square217he1a6ffbcf6ea74f2E, could not find source function
I tried this code:
I expected to see this happen:
d_square
andd_square2
should both compute the derivative of x*x, thus 2.0 * x. However, LLVM (or something earlier?) recognizes that square and square2 are identical, and fuses them (ReplaceAllUsesWith, or RAUW for LLVM). autodiff then is missing a (source) function to differentiate, giving the following error. This is often happening in our test cases, where we just test the same dummy functions in a lot of different configurations.Instead, this happened:
Meta
rustc --version --verbose
:Backtrace
Tracking:
The text was updated successfully, but these errors were encountered: