swift
98535703 - [AutoDiff] Add 'Builtin.applyTranspose*'. (#28469)

Commit
5 years ago
[AutoDiff] Add 'Builtin.applyTranspose*'. (#28469) Add support for applying the transpose function in a `@differentiable(linear)` function. The `Builtin.applyTranspose*` builtin takes a `@differentiable(linear)` function and a tangent vector, and returns the result of applying the transpose to the tangent vector. Pseudo-declaration: ```swift func applyTranspose_arity{arity}[_throws?{r}]<T...{arity}, R>( _: @differentiable (T...) {r}?throws -> R, _: R ) {r}?rethrows -> (T...) where T: Differentiable & AdditiveArithmetic, R: Differentiable & AdditiveArithmetic ``` This patch also renames `Builtin.autodiffApply` to `Builtin.applyDerivative` for clarity, and fixes a bug in `LinearDifferentiableSILFunctionTypeLowering` where it expected 3 component values in `rebuildAggregate` instead of 2. Resolves SR-11844 and SR-11851.
Author
Parents
Loading