Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Tom de Geus
    @tdegeus
    (For free-function there is no real issue here, it is really for classes that things are very hairy)
    Tom de Geus
    @tdegeus
    Just trying the dirty hack #define xtensor pytensor for fun gives a segmentation fault, because
    https://github.com/xtensor-stack/xtensor/blob/53ad31cf5d11b376de0d9e5eac91d6e7351c3cc3/include/xtensor/xsort.hpp#L155
    does not properly resize the output
    Johan Mabille
    @JohanMabille
    wow might be an issue actually
    we should run the xtensor test suite on bindings
    Tom de Geus
    @tdegeus
    Indeed, I've been hitting small things like this
    Tom de Geus
    @tdegeus
    So it seems that even though an intializer_list with one item is passed, https://github.com/xtensor-stack/xtensor/blob/53ad31cf5d11b376de0d9e5eac91d6e7351c3cc3/include/xtensor/xcontainer.hpp#L958 dim == 2??
    Tom de Geus
    @tdegeus
    Calling with #define xtensor pytensor and xt::xtensor<size_t, 2>
    Tom de Geus
    @tdegeus
    and yes, we should really improve our testing of the language bindings
    Tom de Geus
    @tdegeus
    Following our discussion this morning: is there a disadvantage if I fully switch to xtensor-python for some research code (other that I limit my scope)? Is there any possible performance impact? Will xsimd still work? @JohanMabille
    Johan Mabille
    @JohanMabille
    Yes xsimd will work (as long as you don't allocate non contiguous arrays / views, but that's the same in xtensor)
    the underlying numpy array structure is a bit more involved than a C++ standard container, but I'm really not sure it would have a significative impact on performances
    Tom de Geus
    @tdegeus
    "really not sure" means 'probably not' or 'might I really don't know'?
    Johan Mabille
    @JohanMabille
    probably not ;)
    Hameer Abbasi
    @hameerabbasi
    Hello! Is there a good reason including xtensor via FetchContent wouldn't work properly? Is there an interest in making it work?
    8 replies
    Hameer Abbasi
    @hameerabbasi
    Can someone look into xtensor-stack/xsimd#735, I'm willing to fix it if someone just points me to where.
    Mario Emmenlauer
    @emmenlau
    @hameerabbasi I do not think that there is a bug in xsimd or xtensor for this code, because its pretty straightforward. If this where broken, more people should report errors. Could you test your code on godbolt or some online compiler, so its easier to investigate?
    hameer-spire
    @hameer-spire
    It's reproducible on Godbolt, I also commented the link on the issue: https://godbolt.org/z/vj4fEGzqq
    You can comment out the #define then it works fine.
    Mario Emmenlauer
    @emmenlau
    Yep, looks legit. Interesting.
    hameer-spire
    @hameer-spire

    Another one... bool handling is wonky in general, this one doesn't need xsimd either. https://godbolt.org/z/bhh7Kfcen

    Remove the true && to make it work.

    Johan Mabille
    @JohanMabille
    this latest error is legit
    when you write true && (xt::view(a, 1) < 0.0), you create an unevaluated xfunction that cannot be cast to a bool
    you need to evaluate it first:
    true && (xt::view(a, 1) < 0.0)()
    hameer-spire
    @hameer-spire
    Thanks for the insight!
    May I ask what the difference is between an xfunction and an xexpression?
    Johan Mabille
    @JohanMabille
    xfunction is a kind of xexpression
    or said differently, xexpression is a CRTP base class of xfunction
    hameer-spire
    @hameer-spire
    That makes sense, thanks. :)
    Johan Mabille
    @JohanMabille
    I've just released xtensor-python 0.26.1, it fixes a huge bug in the broadcasting
    Mario Emmenlauer
    @emmenlau
    The bug affects only xtensor-python, other projects are fine?
    Johan Mabille
    @JohanMabille
    I haven't checked xtensor-r and xtensor-julia yet, but pure cpp projects are not affected
    the issue was due to the way we adapt and handle strides
    in xtensor, when a dimension's size is one, we set the stride to 0
    it's not the case in numpy
    Mario Emmenlauer
    @emmenlau
    ah, ok makes sense. But good to know that pure c++ is not affected
    hameer-spire
    @hameer-spire
    Does anyone have an idea how onw could get xtensor into a CIBuildWheel job?
    Johan Mabille
    @JohanMabille
    @hameer-spire we build a wheel for xeus-python, you can find it here
    I guess it should be pretty similar for xtensor (even simpler since it's a pure header library, nothing to build)
    Valentin De Matos
    @Thytu

    Hey, I have a question regarding (micro)mamba

    Is there any way to use the run command with stacked env?
    (something like micromamba run -n my_base_env --stacked my_second_env -- stacked my_third_env python something.py)

    Wolf Vollprecht
    @wolfv
    Hi Valentin, good question
    I think this is not yet implemented
    but it shouldn't be too hard to do
    do you want to take a stab at it? I'd be happy to help!
    Valentin De Matos
    @Thytu
    With pleasure, it would be an opportunity to see how mamba works
    Wolf Vollprecht
    @wolfv
    Awesome!
    hameer-spire
    @hameer-spire
    Question... How does one iterate over xtensor? axis_begin and axis_end works with xarray but not xtensor. Error in thread.
    3 replies
    Andrew Cassidy
    @drewcassidy
    Is there a way to specify length when running load in xsimd? I have a data structure of 16 16-bit values I need to load. This would work fine in 128-bit and 256-bit architectures, but short of disallowing AVX512 at compile time, how do I make sure that doesnt result in an overflow and always uses 256-bits max?
    hameer-spire
    @hameer-spire
    Could anyone look at my implementation of pairwise distance (just two lines) and tell me why it doesn't execute as fast as a simple for-loop?
    auto diff = xt::view(in1, xt::all(), xt::newaxis(), xt::all())
                             - xt::view(in2, xt::newaxis(), xt::all(), xt::all());
    xt::view(state.pairwise_distance, xt::all(), xt::all())
                    = xt::sqrt(xt::sum(diff * diff, { 2 }));