Add explicit copy(x::TrackedArray) method
This commit is contained in:
parent
36f5f274a5
commit
27fec15fcc
@ -43,6 +43,8 @@ end
|
||||
|
||||
Base.print_array(io::IO, x::TrackedArray) = Base.print_array(io, data(x))
|
||||
|
||||
Base.copy(x::TrackedArray) = copy(data(x))
|
||||
|
||||
Base.setindex!(xs::TrackedArray, v, i...) =
|
||||
error("Can't differentiate `setindex!`")
|
||||
|
||||
|
@ -23,6 +23,8 @@ end
|
||||
|
||||
Base.decompose(x::TrackedReal) = Base.decompose(data(x))
|
||||
|
||||
Base.copy(x::TrackedArray) = copy(data(x))
|
||||
|
||||
Base.convert(::Type{T}, x::TrackedReal{S}) where {T<:Real,S} = convert(T, data(x))
|
||||
|
||||
Base.convert(::Type{TrackedReal{T}}, x::TrackedReal{T}) where T = x
|
||||
|
Loading…
Reference in New Issue
Block a user