13 std::vector<std::vector<std::vector<float>>> input_tensor_values;
14 input_tensor_values.resize(10000, std::vector<std::vector<float> >(28,std::vector<float>(28)));
15 std::ifstream
file (full_path.c_str(), std::ios::binary);
17 int number_of_images=0;
20 file.read((
char*)&magic_number,
sizeof(magic_number));
21 magic_number= ntohl(magic_number);
22 file.read((
char*)&number_of_images,
sizeof(number_of_images));
23 number_of_images= ntohl(number_of_images);
24 file.read((
char*)&n_rows,
sizeof(n_rows));
25 n_rows= ntohl(n_rows);
26 file.read((
char*)&n_cols,
sizeof(n_cols));
27 n_cols= ntohl(n_cols);
28 for(
int i=0;
i<number_of_images;++
i)
30 for(
int r=0;
r<n_rows;++
r)
32 for(
int c=0;
c<n_cols;++
c)
35 file.read((
char*)&temp,
sizeof(temp));
36 input_tensor_values[
i][
r][
c]=
float(temp)/255;
40 return input_tensor_values;