From 787cb5561003ef33564a4ae958895c2664b8d233 Mon Sep 17 00:00:00 2001 From: Michael Abbott <32575566+mcabbott@users.noreply.github.com> Date: Tue, 28 Nov 2023 09:26:29 -0500 Subject: [PATCH] print eltype too --- src/layers/show.jl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/layers/show.jl b/src/layers/show.jl index f07025e5bc..c32757eddf 100644 --- a/src/layers/show.jl +++ b/src/layers/show.jl @@ -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)