ChainRulesCore.ignore_derivatives
https://juliadiff.org/ChainRulesCore.jl/stable/api.html#Ignoring-gradients