Changeset 1666945
- Timestamp:
- Dec 29, 2021, 5:52:03 PM (3 years ago)
- Branches:
- feature/crepe
- Children:
- 6f53da8
- Parents:
- 636bc43
- git-author:
- Paul Brossier <piem@piem.org> (01/29/19 03:58:40)
- git-committer:
- Paul Brossier <piem@piem.org> (12/29/21 17:52:03)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/file_hdf5.c
r636bc43 r1666945 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.