Skip to content

Commit 488b66c

Browse files
committed
Merge branch 'main' into gd/enzyme_secondorder_functionannot
2 parents 0744082 + 325f2b8 commit 488b66c

4 files changed

Lines changed: 34 additions & 2 deletions

File tree

DifferentiationInterface/CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,18 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased](https://github.com/JuliaDiff/DifferentiationInterface.jl/compare/DifferentiationInterface-v0.7.12...main)
8+
## [Unreleased](https://github.com/JuliaDiff/DifferentiationInterface.jl/compare/DifferentiationInterface-v0.7.13...main)
9+
10+
## [0.7.13](https://github.com/JuliaDiff/DifferentiationInterface.jl/compare/DifferentiationInterface-v0.7.12...DifferentiationInterface-v0.7.13)
11+
12+
### Added
13+
14+
- Allow non-numeric arguments with AutoSymbolics ([#945](https://github.com/JuliaDiff/DifferentiationInterface.jl/pull/945))
15+
16+
### Fixed
17+
18+
- Improve wrong-mode pushforward/pullback ([#932](https://github.com/JuliaDiff/DifferentiationInterface.jl/pull/932), [#931](https://github.com/JuliaDiff/DifferentiationInterface.jl/pull/931))
19+
- Clean up CI ([#926](https://github.com/JuliaDiff/DifferentiationInterface.jl/pull/926), [#924](https://github.com/JuliaDiff/DifferentiationInterface.jl/pull/924))
920

1021
## [0.7.12](https://github.com/JuliaDiff/DifferentiationInterface.jl/compare/DifferentiationInterface-v0.7.11...DifferentiationInterface-v0.7.12)
1122

DifferentiationInterface/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DifferentiationInterface"
22
uuid = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
33
authors = ["Guillaume Dalle", "Adrian Hill"]
4-
version = "0.7.12"
4+
version = "0.7.13"
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"

DifferentiationInterface/ext/DifferentiationInterfaceSymbolicsExt/DifferentiationInterfaceSymbolicsExt.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dense_ad(backend::AutoSparse{<:AutoSymbolics}) = ADTypes.dense_ad(backend)
2626

2727
variablize(::Number, name::Symbol) = variable(name)
2828
variablize(x::AbstractArray, name::Symbol) = variables(name, axes(x)...)
29+
variablize(::T, name::Symbol) where {T} = variable(name; T)
2930

3031
function variablize(contexts::NTuple{C, DI.Context}) where {C}
3132
return ntuple(Val(C)) do k

DifferentiationInterface/test/Back/Symbolics/test.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,23 @@ test_differentiation(
4141
@test sparsity_pattern(jac!_prep) == Diagonal(trues(10))
4242
@test sparsity_pattern(hess_prep) == Diagonal(trues(10))
4343
end
44+
45+
@testset "Non-numeric arguments" begin
46+
function differentiate_me!(out, x, c)
47+
@assert c isa Any # Just to use it somewhere
48+
return copyto!(out, x)
49+
end
50+
function differentiate_me(x, c)
51+
tmp = similar(x)
52+
differentiate_me!(tmp, x, c)
53+
return tmp
54+
end
55+
x = rand(10)
56+
xbuffer = copy(x)
57+
c = "I am a string"
58+
backend = AutoSymbolics()
59+
jac_prep = prepare_jacobian(differentiate_me, backend, x, Constant(c))
60+
jac!_prep = prepare_jacobian(differentiate_me!, xbuffer, backend, x, Constant(c))
61+
@test jacobian(differentiate_me, jac_prep, backend, x, Constant(c)) I
62+
@test jacobian(differentiate_me!, xbuffer, jac!_prep, backend, x, Constant(c)) I
63+
end

0 commit comments

Comments
 (0)