Closed bwehlin closed 4 months ago
@bwehlin The easiest way to solve this is using xt::eval
which will evaluate your view. This could be sub-optimal for performance but chances are you will exceed the inlining ability of the compiler anyways if your types are too nested. Every compiler has a depth limit for inlining functions.
@spectre-ns this looks promising. My case is a bit nonstandard in that I'm storing non-POD types in my xt::array
s and the heavy computation happens outside xtensor. In other words, I use xtensor more as a data container than for computation. As such, I don't think there will be a big issue in terms of performance. Thanks, I will try this for some realistic cases later.
@bwehlin did this fix your issue?
@spectre-ns I haven't fully tested this yet but it appears to do what I want. I'll close this issue for now and if something else pops up I can perhaps reopen this or open a new ticket. Either way, thanks for your help.
Hi,
I need to take views of views, and views of views of views, and so on. This leads to a template explosion since the datatype of, e.g.,
xt::strided_view(array, ...)
is different from that ofxt::strided_view(xt::strided_view(array, ...), ...)
, and so on.Is there a way to cast views into some kind of unified type that can handle arbitrary view "depths"? Ideally, this would also handle e.g., reshape views.
Thanks!