Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 14 files with indirect coverage changes 🚀 New features to boost your workflow:
|
| Adapt.adapt_structure(to, x::AdjointTensorMap) = adjoint(Adapt.adapt(to, parent(x))) | ||
|
|
||
| function LinearAlgebra.norm(t::AdjointTensorMap, p::Real = 2) | ||
| InnerProductStyle(t) === EuclideanInnerProduct() || throw_invalid_innerproduct(:norm) |
There was a problem hiding this comment.
Not really related to this PR, but I am confused how we ever ended up in this situation. The InnerProductStyle check only makes sense if we compute the norm with p==2. For all other values of p, this norm has nothing to do with the inner product anyway, so why should we check. Then again, for all other values of p, this norm doesn't really have a clear physical meaning; it depends on the chosen way to store the tensor data. In particular, norm(t, p) ≈ norm(convert(Array, t), p) will only hold for p == 2.
There was a problem hiding this comment.
Related: #548, I would still be very happy to simply remove most of this, it adds quite a bit of boilerplate that is not really usable
There was a problem hiding this comment.
Should I then leave this in place, for now?
This should give us
normalize!(t, Inf)for free as well. The issue right now is the LinearAlgbra methods cause scalar indexing errors due to the checks they'll do onviews, but for this specific case we can go directly to the underlying data array.