EnzymeAD / EnzymeAD/Enzyme.jl

Compilation failed when using `spdiagm`

Open
#2,108 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
586
Forks
108
Avg merge
1d 5h
Merged PRs (30d)
44

Description

The following code fails

```julia
function f(p)
A = spdiagm(0 => 1:11, 1 => p)
return sum(A)
end

p = rand(10)

f(p)

Enzyme.gradient(Reverse, f, p)
```

But it works if for example I use `A = spdiagm(0 => ones(11), 1 => p)`.

The error is

```julia
ERROR: Enzyme compilation failed due to illegal type analysis.
Current scope:
; Function Attrs: mustprogress willreturn
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.