GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Bug in sort · Issue #262 · xtensor-stack/xtensor-python

Bug in sort #262

New issue
Copy link
New issue
Copy link
Open
Open
Bug in sort#262
Copy link

Description

@tdegeus
tdegeus
opened on May 28, 2021
Issue body actions

The following code

#include <xtensor.hpp>
#include <pybind11/pybind11.h>

namespace py = pybind11;

#define FORCE_IMPORT_ARRAY
#include <xtensor-python/pyarray.hpp>
#include <xtensor-python/pytensor.hpp>

template <class T>
inline auto foo(const T& arg)
{
    return xt::sort(arg);
}

PYBIND11_MODULE(mymodule, m)
{
    xt::import_numpy();
    m.doc() = "Module description";
    m.def("foo", &foo<xt::pytensor<size_t, 1>>, "Function description", py::arg("arg"));
}

Gives:

...\include\xtensor\xsort.hpp(155,31): error C2397: conversion from 'unsigned __int64' to '_Ty' requires a narrowing conversion with
          [
              _Ty=ptrdiff_t
          ]
...\include\xtensor\xsort.hpp(204): message : see reference to function template instantiation 'auto xt::detail::flat_sort_impl<xt::pytensor<size_t,1,xt::layout_type::dynamic>,eval_type>(const xt::xexpression<D> &)' being compiled with
          [
              D=xt::pytensor<size_t,1,xt::layout_type::dynamic>
          ]
...\main.cpp(13): message : see reference to function template instantiation 'auto xt::sort<D>(const xt::xexpression<D> &,ptrdiff_t)' being compiled with
          [
              D=xt::pytensor<size_t,1,xt::layout_type::dynamic>
          ]
...\main.cpp(20): message : see reference to function template instantiation 'auto foo<xt::pytensor<size_t,1,xt::layout_type::dynamic>>(const T &)' being compiled with
          [
              T=xt::pytensor<size_t,1,xt::layout_type::dynamic>
          ]

on Windows. It works fine on macOS, and gives a very vague error message on Linux.

For full CI, see tdegeus/xtensor-python_examples#1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.