Conversation
…adcastshape methods
marimeireles
left a comment
There was a problem hiding this comment.
Hey @JohanMabille here are some questions about the dispatcher stuff.
Also is this the way to go to implement the macros?
Thanks!
| //AX m_axes; | ||
| //OX m_options; | ||
| //are all of these args gonna be inside of my m_args? | ||
| detail::strided_view_args<detail::no_adj_strides_policy> m_args; |
There was a problem hiding this comment.
I'm confused in how I should dispatch elements for the reducer. What are the elements that should be dispatched and what are the accessory ones?
There was a problem hiding this comment.
The elements that should be dispatched are those wrapped in a zarray. For the reducer (like the view), this means the underlying expression only.
There was a problem hiding this comment.
@JohanMabille
ok, so the xreducer on xtensor doesn't have a type strided_view_args for itself.
Meaning I'll have to create something like this, right? It seems kinda complex, is this really the way to go? and... I'm not really sure where I should make these changes, maybe on the xreducer.hpp file that I'm working on?
Thanks!
There was a problem hiding this comment.
I'll start with a simple struct
| template <class CT, class Func, class AX, class OX> | ||
| template <class FuncA, class CTA, class AXA, class OXA> | ||
| inline zreducer<CT>::zreducer(FuncA&& func, CTA&& e, AXA&& axes, OXA&& options)noexcept | ||
| //do i need forward here |
There was a problem hiding this comment.
Do these things need to be forwarded?
There was a problem hiding this comment.
Yes, this is required for e. For other arguments, it's a convenient optimization.
| auto shape = e.shape(); | ||
| auto offset = e.get_implementation().get_offset(); | ||
| auto layout = e.layout(); | ||
| m_args.fill_args(shape, strides, offset, layout, slices); |
There was a problem hiding this comment.
what should I receive here in my m_args?
template <class FuncA, class CTA, class AXA, class OXA>
zreducer(FuncA&& func, CTA&& e, AXA&& axes, OXA&& options)
Axes and options?
While func and e should be dispatched?
There was a problem hiding this comment.
axes and options. You should dispatch on e only, func should probably be handled th same way we handle functors for operations (a zfunctor mapped to an xfunctor and used an template argument of the dispatcher class)
|
Hi @marimeireles sorry for the late reply. It appeared that using the dispatchers for building views required evaluating the underlying expression, which might not play well with chunked arrays and big data. Thus we totally changed the approach and decided to have the wrapper build the view. I'm afraid we need to do the same here, that is, forget the dispatchers, and implement a |
This PR is going to have a lot of experimental commits. Mainly to keep Johan on the loop =)