JuliaGPU/CUDA.jl

Should compact `show` mark `CuArray`s?

Open

#1,190 建立於 2021年10月6日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)Julia (274 fork)batch import
enhancementgood first issue

倉庫指標

Star
 (1,408 star)
PR 合併指標
 (平均合併 5天 5小時) (30 天內合併 16 個 PR)

描述

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.

貢獻者指南