You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code to load a binary matrix and prints its values results in the ASCII values of the elements being loaded, i.e. 48 and 49 instead of 0 and 1. Is this an unsupported use case of the API?
#include<iostream>
#include<fstream>
#include<xtensor/xarray.hpp>
#include<xtensor/xcsv.hpp>
#include<xtensor/xio.hpp>
#include<stdint.h>intmain() {
std::ifstream f;
f.open("/tmp/mymatrix.csv");
if (!f.is_open()) {
throwstd::runtime_error("failed to open file");
}
xt::xarray<uint8_t> m = xt::load_csv<uint8_t>(f);
f.close();
std::cout << m << std::endl;
return0;
}
Activity
JohanMabille commentedon Apr 30, 2026
Fixed in #2904