I have written something on adjoints, they are literally everywhere https://github.com/adamnemecek/adjoint