JuliaDiff / JuliaDiff/ChainRulesCore.jl
ProjectTo(Adjoint{<:SparseMatrixCSC})(::Matrix) does not preserve sparsity
Open
Nobody has claimed this yet.
bug
ProjectTo
- Dominant language
- Julia
- Stars
- 267
- Forks
- 66
- PR merge metrics
- No merged PRs in 30d
Description
Consider:
julia> x = sprand(3,3, 0.2)
3×3 SparseMatrixCSC{Float64, Int64} with 4 stored entries:
0.289391 ⋅ 0.43614
⋅ 0.427879 ⋅
⋅ ⋅ 0.332239
julia> xt = x'
3×3 adjoint(::SparseMatrixCSC{Float64, Int64}) with eltype Float64:
0.289391 0.0 0.0
0.0 0.427879 0.0
0.43614 0.0 0.332239
julia> ProjectTo(xt)(ones(3,3))
3×3 Matrix{Float64}:
1.0 1.0 1.0
1.0 1.0 1.0
1.0 1.0 1.0
cc @jieli-matrix
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 REPL example for ProjectTo(Adjoint{<:SparseMatrixCSC})(::Matrix) and inspect the resulting type and stored entries. Done means applying ProjectTo to a dense matrix preserves the sparse structure shown by the adjoint target; no repository files or tests are named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100