Skip to content

Instantly share code, notes, and snippets.

Avatar

Simeon Schaub simeonschaub

  • Cambridge, MA
View GitHub Profile
View toy_chainrules_cassette_ad.jl
using Cassette, Test
using Cassette: @context, enabletagging, @overdub, overdub, recurse,
hasmetadata, metadata, tag, untag
using ChainRules: frule, Zero, extern
@context DiffCtx
Cassette.metadatatype(::Type{<:DiffCtx}, ::Type{T}) where {T<:Real} = T
function D(f, x)