JuliaGPU/CUDA.jl

Should compact `show` mark `CuArray`s?

Open

#1.190 geöffnet am 6. Okt. 2021

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Julia (274 Forks)batch import
enhancementgood first issue

Repository-Metriken

Stars
 (1.408 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 5T 5h) (16 gemergte PRs in 30 T)

Beschreibung

The compact printing used within a Tuple etc. doesn't at present distinguish a CuArray from an ordinary Array:

julia> (; x = cu([1f0]))  # CUDA v3.4.2
(x = Float32[1.0],)

julia> (; x = [1f0])
(x = Float32[1.0],)

Maybe it should? This came up in https://github.com/FluxML/Zygote.jl/issues/1095 , but more generally Zygote likes to return tuples of arrays, and having a visible distinction might be helpful.

This could just be cu(Float32[1.0]) but perhaps that's not right for all eltypes.

Contributor Guide