Fix: made load_hd5 check blob dims by default.
[platform/upstream/caffeonacl.git] / include / caffe / util / hdf5.hpp
1 #ifndef CAFFE_UTIL_HDF5_H_
2 #define CAFFE_UTIL_HDF5_H_
3
4 #include <string>
5
6 #include "hdf5.h"
7 #include "hdf5_hl.h"
8
9 #include "caffe/blob.hpp"
10
11 namespace caffe {
12
13 template <typename Dtype>
14 void hdf5_load_nd_dataset_helper(
15     hid_t file_id, const char* dataset_name_, int min_dim, int max_dim,
16     Blob<Dtype>* blob, bool reshape);
17
18 template <typename Dtype>
19 void hdf5_load_nd_dataset(
20     hid_t file_id, const char* dataset_name_, int min_dim, int max_dim,
21     Blob<Dtype>* blob, bool reshape = false);
22
23 template <typename Dtype>
24 void hdf5_save_nd_dataset(
25     const hid_t file_id, const string& dataset_name, const Blob<Dtype>& blob,
26     bool write_diff = false);
27
28 int hdf5_load_int(hid_t loc_id, const string& dataset_name);
29 void hdf5_save_int(hid_t loc_id, const string& dataset_name, int i);
30 string hdf5_load_string(hid_t loc_id, const string& dataset_name);
31 void hdf5_save_string(hid_t loc_id, const string& dataset_name,
32                       const string& s);
33
34 int hdf5_get_num_links(hid_t loc_id);
35 string hdf5_get_name_by_idx(hid_t loc_id, int idx);
36
37 }  // namespace caffe
38
39 #endif   // CAFFE_UTIL_HDF5_H_