Inactive rule not working on identity function
Open
- Dominant language
- Julia
- Stars
- 586
- Forks
- 108
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 44
Description
MWE:
```julia
using Enzyme
import .EnzymeRules: forward, reverse, augmented_primal, inactive
using .EnzymeRules
myidentity(x) = x
EnzymeRules.inactive(::typeof(myidentity), args...) = nothing
autodiff(Forward, myidentity, Duplicated(3.0, 1.0)) # gives 1.0 rather than 0.0
```
It works if `myidentity(x) = 2*x` though (i.e. output is `0.0` then)
I'm guessing `myidentity` is just optimized out before Enzyme sees it? So don't know if this really a bug or not: maybe incorrect `inactive` rules are just undefined behaviour
Contributor guide
Assessment
This issue has not been assessed yet.