Skip to content

Commit 455b151

Browse files
committed
Implement Base.show, not Base.print_array.
Printing tuples of arrays triggers assertscalar through _show_nonempty, not all of which call print_array.
1 parent 3f45485 commit 455b151

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/abstractarray.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ end
5656

5757
## showing
5858

59-
Base.print_array(io::IO, x::GPUArray) = Base.print_array(io, collect(x))
60-
Base.print_array(io::IO, x::LinearAlgebra.Adjoint{<:Any,<:GPUArray}) = Base.print_array(io, LinearAlgebra.adjoint(collect(x.parent)))
61-
Base.print_array(io::IO, x::LinearAlgebra.Transpose{<:Any,<:GPUArray}) = Base.print_array(io, LinearAlgebra.transpose(collect(x.parent)))
59+
Base.show(io::IO, x::GPUArray) = Base.show(io, Array(x))
60+
Base.show(io::IO, x::LinearAlgebra.Adjoint{<:Any,<:GPUArray}) =
61+
Base.show(io, LinearAlgebra.adjoint(Array(x.parent)))
62+
Base.show(io::IO, x::LinearAlgebra.Transpose{<:Any,<:GPUArray}) =
63+
Base.show(io, LinearAlgebra.transpose(Array(x.parent)))
6264

6365

6466
# memory operations

0 commit comments

Comments
 (0)