Created
April 22, 2022 01:40
-
-
Save philipturner/3c073913120d7c51afce007d58fdd918 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import _Differentiation | |
func myFunc(x: Float, y: Float) -> Float { x + y } | |
let item: @differentiable(reverse) (Float, Float) -> Float = myFunc | |
class Box<T> { | |
var value: T | |
init(value: T) { | |
self.value = value | |
} | |
} | |
let box = Box(value: item) | |
let retrieved = box.value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Linked to: https://gist.github.com/philipturner/260d44f889c58f83bc3c3d7d830cbe1b