See https://github.com/tdegeus/test_pybind/pull/6 and an attempt to reproduce https://github.com/xtensor-stack/xtensor-python/pull/274