Introduce a `isa_wrapped_array` function
還沒有人認領這個 Issue。
評估
研究方向
從 PR 369 的 issue 評論中的詳細資訊開始,尤其關注提議的 isa_wrapped_array 行為和 LinearAlgebra.diag overlay 範例。確定下游陣列型別所需的介面,以及它如何支援自訂直譯器使用情境。當引入的函式行為符合該規格,且相關用法得到涵蓋時,即視為完成。
由索引模型根據 Issue 內容生成。
描述
Most details are in https://github.com/EnzymeAD/Reactant.jl/pull/369#issuecomment-2541402690. I will copy over the important parts.
We introduce a function isa_wrapped_array that downstream packages can use to mark that their array type wraps another array. Using a union type from Adapt doesn't solve this problem, because that fundamentally doesn't extend to new array types.
With this function, we can override functions inside our custom interpreter. Consider this simple example of extending LinearAlgebra.diag
Base.Experimental.@overlay REACTANT_METHOD_TABLE function LinearAlgebra.diag(
x::AbstractArray{T,2}, k::Integer=0
) where {T}
if isa_wrapped_array(x) && ancestor(x) isa TracedRArray
y = materialize_traced_array(x) # convert it to a known type
return diag(y, k)
else
# invoke diag(x) on NativeInterpreter
end
end
- 主要語言
- Julia
- 星號
- 141
- 分支
- 45
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
JuliaArrays/ArrayInterface.jl 的其他 Issue
-
lu_instance/qr_instance run a full factorization for FixedSizeArrays可能已有人在做 @devmotion 於 22 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
JuliaArrays/ArrayInterface.jl#510 ·
-
難度 5/5 一週以上 新手友好度 25/100
JuliaArrays/ArrayInterface.jl#499 ·
-
難度 5/5 一週以上 新手友好度 25/100
JuliaArrays/ArrayInterface.jl#463 · 5 則留言 · 4 個 reaction ·
-
難度 4/5 3-5 天 新手友好度 35/100
JuliaArrays/ArrayInterface.jl#397 · 1 則留言 ·
-
難度 4/5 3-5 天 新手友好度 15/100
JuliaArrays/ArrayInterface.jl#396 ·
查看 JuliaArrays/ArrayInterface.jl 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
rfordatascience/tidytuesday#1098 ·
-
`SplitRungeKutta` time steppers never call `update_lagrangian_particle_state!`, so particle `tracked_fields` are never updated可能已有人在做 @ali-ramadhan 今天認領。 未關閉bug 🐞
難度 2/5 1-3 小時 新手友好度 76/100
CliMA/Oceananigans.jl#6381 ·
維護者通常 1 天內回覆
-
ci system:windows test
難度 1/5 1 小時以內 新手友好度 76/100
維護者通常 1 天內回覆
-
Single-column TKE example: boundary-layer depth description doesn't match Han & Bretherton (2019)未關閉
難度 1/5 1-3 小時 新手友好度 82/100
NumericalEarth/Breeze.jl#1143 ·
維護者通常 1 天內回覆
-
format-check (Runic) is red on master: formatter drift on ~200 files可能已有人在做 @ChrisRackauckas-Claude 於 1 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 62/100
SciML/ModelingToolkit.jl#5337 · 1 則留言 ·
維護者通常 3 天內回覆