swift
fb8f187a - [AutoDiff] Add VJP for 'Array.init(repeating:count:)'. (#27255)

Comment changes are shownComment changes are hidden
Commit
5 years ago
[AutoDiff] Add VJP for 'Array.init(repeating:count:)'. (#27255) Add a VJP for `Array.init(repeating:count:)` so that it can be differentiated. The VJP is merely a transpose since `init(repeating:count:)` is linear w.r.t. the repeated value. Its tranpose is a linear map that takes an `Array.TangentVector` and returns the sum of all of its elements. Resolves [TF-802](https://bugs.swift.org/browse/TF-802).
Author
Parents
  • stdlib/public/core
    • File
      Array.swift
  • test/AutoDiff
    • File
      array.swift