Closed dcrc2 closed 3 years ago
I've just realised I've named these badly, sorry.
"Forward" should really be reserved for "compute the function, and anything else needed for a subsequent backward"
[edited:] I think now we should call the entry points "func", and "func_vjp". (Or indeed "entry" and "entry_vjp").
Then KscAutogradFunction can decide to make use of them in its "forward" and "backward" pending #768
I think now we should call the entry points "func", and "func_vjp". (Or indeed "entry" and "entry_vjp").
OK, renamed to entry
and entry_vjp
.
This PR renames the pybind entry points to be ~forward and backward~
entry
andentry_vjp
irrespective of whether LM AD is used. (Previously the backward entry point was eitherrev_entry
orsufrev_entry
.)In particular, for the embedded C++ examples, this means that any two C++ functions can be used as the entry points. I've removed the
generate_lm
parameter fromcpp_string_to_autograd_function
, which didn't really make sense in this context as nothing is being generated.In order for this to work, the embedded C++ examples need to have C++ functions with the correct names (
entry
andentry_vjp
). I've done this here by adding trivial forwarding functions with the correct name, rather than by changing the existing names. This is done with PRs #925 and #931 in mind: the forwarding function will need to do a little more work when those PRs are merged. I'm intending to rebase those PRs onto this one.Note that these changes mean that we no longer generate an entry point for
[fwd f]
when LM AD is requested. I don't think we were actually using this anywhere.