fwAD source code dual numbers

I am working on a project to use forward differentiation using dual numbers. Is there a C++ way to access fwAD? Was fwAD implemented in pure Python? If not could you please point me to the implementation source code? Thank you.

There are some implementation notes in torch/csrc/autograd/forward_grad.h

The analogous functions in cpp are:

  • dual_level: `torch::autograd::forward_ad::enter_dual_level()
  • make_dual: at::_make_dual
  • unpack_dual: at::_unpack_dual

Forward AD was mainly implemented with Python in mind, so these are mostly private APIs that we don’t officially support.