Does the type assert occur in your code? This prevents ForwardDiff from using dual numbers. In Zygote’s case, it might be a missing gradient definition (see this discussion) for some data structure. For example, you can’t diff through code using FieldVectors, maybe this is the case for one of your data structures too. You could try replacing your OrderedDicts with ordinary ones.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Help making ForwardDiff.derivative work | 2 | 37 | January 24, 2025 | |
Trouble using ForwardDiff on a function with a cache vector and a custom struct | 1 | 609 | July 2, 2021 | |
Getting ForwardDiff.Dual to propagate through function | 5 | 640 | December 13, 2023 | |
ForwardDiff cannot assign ForwardDiff.Dual to input array | 5 | 1362 | April 13, 2020 | |
Help to create a structure to use ForwardDiff package | 5 | 648 | January 22, 2020 |