Skip to content

Commit ccadb9e

Browse files
committed
Relax typing, add Adapt bound
1 parent b8b023b commit ccadb9e

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

DifferentiationInterface/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ DifferentiationInterfaceTrackerExt = "Tracker"
5757
DifferentiationInterfaceZygoteExt = ["Zygote", "ForwardDiff"]
5858

5959
[compat]
60+
Adapt = "4.5.0"
6061
ADTypes = "1.18.0"
6162
ChainRulesCore = "1.23.0"
6263
DiffResults = "1.1.0"

DifferentiationInterface/src/utils/linalg.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ onlysecond((a, b)) = (a, only(b))
4141
4242
Convert an array of tuples `tx` into a tuple of arrays, while respecting the array type of the primal `x`.
4343
"""
44-
arroftup_to_tupofarr(tx::NTuple{B, T}, x::T) where {B, T} = tx
44+
arroftup_to_tupofarr(tx::NTuple{B, <:Number}, x::Number) where {B} = tx
4545

46-
function arroftup_to_tupofarr(tx::AbstractArray{NTuple{B, T}}, x::AbstractArray{T}) where {B, T}
46+
function arroftup_to_tupofarr(tx::AbstractArray{<:NTuple{B, <:Number}}, x::AbstractArray{<:Number}) where {B}
4747
return ntuple(b -> similar(x) .= getindex.(tx, b), Val(B))
4848
end

0 commit comments

Comments
 (0)