MCPcopy Create free account
hub / github.com/Samsung/ONE / writeTensorToDatFile

Function writeTensorToDatFile

compiler/nnc/utils/input_gen/tensor_gen.cpp:148–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148static 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
158static void writeTensorToHDF5File(const vector<hsize_t> &dimensions, const string &tensor_name,
159 const string &file_name, Tensor &tensor)

Callers 1

mainFunction · 0.85

Calls 4

numElemsMethod · 0.80
failMethod · 0.45
writeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected