fix array show
This commit is contained in:
parent
a8ccc79f61
commit
1fd49c2a90
@ -28,17 +28,13 @@ Base.eltype(x::Type{<:TrackedArray{T}}) where T <: Real = TrackedReal{T}
|
|||||||
Base.show(io::IO, ::Type{TrackedArray{T,N,A}}) where {T,N,A<:AbstractArray{T,N}} =
|
Base.show(io::IO, ::Type{TrackedArray{T,N,A}}) where {T,N,A<:AbstractArray{T,N}} =
|
||||||
print(io, "TrackedArray{…,$A}")
|
print(io, "TrackedArray{…,$A}")
|
||||||
|
|
||||||
function Base.showarray(io::IO, X::TrackedArray, repr::Bool = true; header = true)
|
function Base.summary(io::IO, x::TrackedArray)
|
||||||
if repr
|
print(io, "Tracked ")
|
||||||
print(io, "param(")
|
summary(io, data(x))
|
||||||
Base.showarray(io, data(X), true)
|
|
||||||
print(io, ")")
|
|
||||||
else
|
|
||||||
header && print(io, "Tracked ")
|
|
||||||
Base.showarray(io, data(X), false, header = header)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Base.print_array(io::IO, x::TrackedArray) = Base.print_array(io, data(x))
|
||||||
|
|
||||||
Base.setindex!(xs::TrackedArray, v, i...) =
|
Base.setindex!(xs::TrackedArray, v, i...) =
|
||||||
error("Can't differentiate `setindex!`")
|
error("Can't differentiate `setindex!`")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user