-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mooncake Backend doesn't handle functions with StaticArrays output #642
Comments
Thanks for reporting this! Can you try it out with the branch from #643 ? |
Thanks for the quick reply! It looks like it's still giving the same error on my end |
Oh right, I had misread the error. Modulo my hotfix, I now think this happens because DI expects an array but Mooncake wraps it into a Tangent. @willtebbutt any idea how we should handle this? |
So this looks to me like it's happening on Line 35 in cc8818a
If I'm not mistaken, we just need to a add a method of function copyto!!(dst::T, src::SVector{3, Float64}) where {T<:Mooncake.Tangent{@NamedTuple{data::Tuple{Float64, Float64, Float64}}}}
return T((data = getfield(src, :data), ))
end in this case. We'll need translation rules like this for most types so, thinking forwards to more general types, we'll never have a complete solution to this translation problem unless DI places some restrictions on the set of types that users are permitted to work with. My understanding is that you're not keen to restrict users in this way, so probably the best thing to do is to define a catch-all method of That being said, it might be that we can do something more general which says "the thing I'm trying to Either way, since static arrays are something people are quite interested in currently, I would suggest just adding a conversion rule for this case, and punting the more general fix down the line -- I'll open an issue on Mooncake which references this issue. Additionally, note that the thing that Mooncake will return in this instance is another |
If a function returns a static array or vector, the AutoMooncake backend errors
Gives the error
The text was updated successfully, but these errors were encountered: