Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoDiff] Enable differentiation of generic functions. #22023

Merged
merged 3 commits into from Jan 21, 2019

Commits on Jan 21, 2019

  1. [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.
    dan-zheng committed Jan 21, 2019
    Configuration menu
    Copy the full SHA
    e2155bf View commit details
    Browse the repository at this point in the history
  2. Add tests.

    TODO: Add more tests.
    dan-zheng committed Jan 21, 2019
    Configuration menu
    Copy the full SHA
    a976a7c View commit details
    Browse the repository at this point in the history
  3. Address comments by @rxwei.

    dan-zheng committed Jan 21, 2019
    Configuration menu
    Copy the full SHA
    ca9e922 View commit details
    Browse the repository at this point in the history