| 146 | } |
| 147 | |
| 148 | static void writeTensorToDatFile(const string &file_name, Tensor &tensor) |
| 149 | { |
| 150 | ofstream of(file_name + ".dat", ios_base::binary); |
| 151 | |
| 152 | if (of.fail()) |
| 153 | cout << "Could not output tensor to the: " << file_name + ".dat"; |
| 154 | |
| 155 | of.write(reinterpret_cast<char *>(tensor.data()), tensor.numElems() * sizeof(float)); |
| 156 | } |
| 157 | |
| 158 | static void writeTensorToHDF5File(const vector<hsize_t> &dimensions, const string &tensor_name, |
| 159 | const string &file_name, Tensor &tensor) |