Closed roflmaostc closed 1 month ago
Working on this, but also FYI for you code, the use of the buffer makes your code both slower [in both primal and reverse], and harder to differentiate.
If you can point me to the code that uses this pattern I can offer some comments to improve perf/compatibility
Thanks for the hint!
I thought I need the buffer to avoid the allocation in the forward pass?
How would I write these line in an Enzyme style?
function f(pp)
buffer .= 0
buffer .-= gauss.(x, y, pp[1], pp[2], pp[3])
#buffer .+= measurement
return sum(abs2, buffer)
end
Thanks!
I think probably a generator would avoid things entirely [no temporary buffer, nor allocation]
@roflmaostc does this still err on current main?
okay locally this seems to run, closing
Hi,
with Enzyme v0.12.25
This works:
This does not, the only line I change is
x = collect(range(-10, 10, 100))
, so I use a vector instead of a range in the function.The error is: