Add support for differentiable function creation.