-
Notifications
You must be signed in to change notification settings - Fork 56
Improve Diagonal constructors with similar_diagonal
#330
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
Conversation
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
src/factorizations/diagonal.jl
Outdated
| V_dom = fuse(domain(t)) | ||
| U = similar(t, codomain(t) ← V_cod) | ||
| S = DiagonalTensorMap{real(scalartype(t))}(undef, V_cod ← V_dom) | ||
| S = similar_diagonal(t, real(scalartype(t)), V_cod ← V_dom) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 🎉 🎉
kshyatt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I think this will really simplify things for the GPU support. Thanks very much for doing this!
Co-authored-by: Jutho <Jutho@users.noreply.github.com>
Co-authored-by: Jutho <Jutho@users.noreply.github.com>
This PR adds the (unexported for now?)
similar_diagonalfunction which acts likesimilarbut instead returns aDiagonalTensorMap.The main point is to facilitate GPU support by correctly taking into account the storage types of the provided input tensor.