Skip to content

Instantly share code, notes, and snippets.

@philipturner
Created April 22, 2022 01:40
Show Gist options
  • Save philipturner/3c073913120d7c51afce007d58fdd918 to your computer and use it in GitHub Desktop.
Save philipturner/3c073913120d7c51afce007d58fdd918 to your computer and use it in GitHub Desktop.
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
@philipturner
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment