JuliaDiff / JuliaDiff/ChainRules.jl
No rules for `typed_hvcat`
Open
Nobody has claimed this yet.
missing rule
- Dominant language
- Julia
- Stars
- 475
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
This causes problems with Zygote:
julia> using Zygote
julia> gradient(x -> sum([x x]), pi/2)
(2.0,)
julia> gradient(x -> sum(Float32[x x]), pi/2)
ERROR: Mutating arrays is not supported -- called setindex!(Matrix{Float32}, ...)
...
[7] typed_hcat
@ Zygote ./abstractarray.jl:1610 [inlined]
Ideally we'd teach ChainRules how to handled this statement without going through to the implementation.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Julia/Zygote gradient examples and inspect the typed_hcat path shown at abstractarray.jl:1610 in the traceback. Determine the ChainRules entry point for this operation; done means the Float32 concatenation gradient no longer reaches Zygote's mutation error while the existing case remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100