Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AutoDiff] Enable differentiation of generic functions.
- Relax differentiability diagnostic for generic functions. - Previously, an error was emitted when attempting to differentiate any generic function. Now, diagnose only functions with indirect differentiation parameters/result. - Propagate differentiation associated function generic signature throughout differentiation pass. - Change `PrimalGenCloner` to inherit `TypeSubstCloner`. - Make primal value structs inherit primal function's generic parameters and signature. - Calculate correct substitution map for `PrimalGenCloner::visitApplyInst`. Emit diagnostic when apply instruction's associated function (e.g. VJP) has generic requirements unmet by the primal generic environment. - Remap types in `AdjointEmitter`. - Remove manually `@differentiable` attribute where clause conformance requirement checks. - `GenericSignatureBuilder` already performs checks so manual checks are unnecessary.
- Loading branch information