Skip to content

problem calculating quantile on pytensor #286

@ThibHlln

Description

@ThibHlln

Hi,

The new added xt::quantile seems not to play nicely with pytensor.

For me, the following :

xt::pytensor<double, 2> arr
            {{ 5.3, 4.3, 5.3 },
             { 4.2, 4.2, 5.2 },
             { 5.7, 4.7, 5.7 },
             { 2.3, 4.3, 2.3 }};

auto q = xt::quantile(arr, {0.3, 0.7}, 1);

raises :

~/xtensor/include/xtensor/xsort.hpp:463:31: error: non-constant-expression cannot be narrowed from type 'xt::xcontainer<xt::pytensor<double, 2, xt::layout_type::dynamic>>::size_type' (aka 'unsigned long') to 'long' in initializer list [-Wc++11-narrowing]
R ev = R::from_shape({de.size()});

I am using xtl==0.7.5, xtensor==0.24.4, xtensor-python==0.26.1, pybind11==2.10.3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions