swift
92cc5938 - [AutoDiff] Support differentiating global constant closures. (#22004)

Commit
6 years ago
[AutoDiff] Support differentiating global constant closures. (#22004) * [AutoDiff] Support differentiating global constant closures. * When there is a reference to a global `let` closure, we find its initializer in `@main`, trace back to the original `function_ref`, and differentiate that. * NFC: Refactor `findReferenceToVisibleFunction` and `findWitnessMethod` to a single template. * Add a global constant closure test that uses tensors. * Add global differentiable closure tests.
Author
Parents
  • include/swift/AST
    • File
      DiagnosticsSIL.def
  • lib/SILOptimizer/Mandatory
    • File
      Differentiation.cpp
  • test
    • AutoDiff
      • File
        simple_math.swift
    • TensorFlowRuntime
      • File
        tensor_autodiff_runtime.swift