Skip to content

Commit

Permalink
print eltype too
Browse files Browse the repository at this point in the history
  • Loading branch information
mcabbott committed Mar 6, 2024
1 parent badbb15 commit 787cb55
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/layers/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,12 @@ end

_layer_string(io::IO, layer) = sprint(show, layer, context=io)
# _layer_string(::IO, a::AbstractArray) = summary(layer) # sometimes too long e.g. CuArray
_layer_string(::IO, a::AbstractArray) = Base.dims2string(size(a)) * " " * String(typeof(a).name.name)
# _layer_string(::IO, a::Array{T}) where T = Base.dims2string(size(a)) * " Array{$T}"
# _layer_string(::IO, a::AbstractArray{T}) where T = Base.dims2string(size(a)) * " AbstractArray{$T}"
function _layer_string(::IO, a::AbstractArray)
full = string(typeof(a))
comma = findfirst(',', full)
short = isnothing(comma) ? full : full[1:comma] * "...}"
Base.dims2string(size(a)) * " " * short
end

function _big_finale(io::IO, m)
ps = params(m)
Expand Down

0 comments on commit 787cb55

Please sign in to comment.