MCPcopy Create free account
hub / github.com/BVLC/caffe / hdf5_load_string

Function hdf5_load_string

src/caffe/util/hdf5.cpp:148–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148string hdf5_load_string(hid_t loc_id, const string& dataset_name) {
149 // Get size of dataset
150 size_t size;
151 H5T_class_t class_;
152 herr_t status = \
153 H5LTget_dataset_info(loc_id, dataset_name.c_str(), NULL, &class_, &size);
154 CHECK_GE(status, 0) << "Failed to get dataset info for " << dataset_name;
155 char *buf = new char[size];
156 status = H5LTread_dataset_string(loc_id, dataset_name.c_str(), buf);
157 CHECK_GE(status, 0)
158 << "Failed to load int dataset with name " << dataset_name;
159 string val(buf);
160 delete[] buf;
161 return val;
162}
163
164void hdf5_save_string(hid_t loc_id, const string& dataset_name,
165 const string& s) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected