Changeset bf3ce2c
- Timestamp:
- Jan 29, 2019, 3:58:40 AM (6 years ago)
- Branches:
- feature/crepe_org
- Children:
- befee7a
- Parents:
- e18c30e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/file_hdf5.c
re18c30e rbf3ce2c 30 30 #include <hdf5_hl.h> 31 31 32 #if !HAVE_AUBIO_DOUBLE 33 #define aubio_H5LTread_dataset_smpl H5LTread_dataset_float 34 #else 35 #define aubio_H5LTread_dataset_smpl H5LTread_dataset_double 36 #endif 37 32 38 struct _aubio_file_hdf5_t { 33 39 const char_t *path; … … 52 58 53 59 uint_t aubio_file_hdf5_load_dataset_into_tensor (aubio_file_hdf5_t *f, 54 const char_t *key, aubio_tensor_t *tensor) { 60 const char_t *key, aubio_tensor_t *tensor) 61 { 55 62 uint_t i; 56 63 AUBIO_ASSERT(f && key && tensor); 57 // check file is open58 if (!f->fid )64 // check arguments 65 if (!f->fid || !key || !tensor) 59 66 return AUBIO_FAIL; 60 67 // find key in file … … 76 83 AUBIO_ASSERT(ndim == (sint_t)tensor->ndim); 77 84 for (i = 0; i < (uint_t)ndim; i++) { 78 //AUBIO_DBG("file_hdf5: found dim %d : %d %d (%s in %s)\n", i, dims[i],79 // tensor->shape[i], key, f->path);80 85 AUBIO_ASSERT(shape[i] == tensor->shape[i]); 81 86 } … … 88 93 // read data from hdf5 file into tensor buffer 89 94 smpl_t *buffer = tensor->buffer; 90 herr_t err = H5LTread_dataset_float(f->fid, key, buffer);95 herr_t err = aubio_H5LTread_dataset_smpl(f->fid, key, buffer); 91 96 92 97 if (err < 0) { 93 98 return AUBIO_FAIL; 94 99 } 100 101 //AUBIO_DBG("file_hdf5: loaded : shape %s from key %s\n", 102 // aubio_tensor_get_shape_string(tensor), key); 95 103 96 104 H5Dclose(data_id);
Note: See TracChangeset
for help on using the changeset viewer.