Changeset f5ea4fb
- Timestamp:
- Jan 2, 2019, 10:53:40 PM (6 years ago)
- Branches:
- feature/cnn_org, feature/crepe_org
- Children:
- 427a48c
- Parents:
- 40520ea
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ai/tensor.c
r40520ea rf5ea4fb 6 6 { 7 7 aubio_tensor_t *c = AUBIO_NEW(aubio_tensor_t); 8 uint_t items_per_row = 1; 8 9 uint_t i; 9 10 … … 14 15 15 16 c->ndim = ndim; 16 uint_t items_per_row = 1;17 //c->shape = AUBIO_ARRAY(uint_t, ndim);18 17 c->shape[0] = shape[0]; 19 18 for (i = 1; i < ndim; i++) { … … 22 21 } 23 22 c->size = items_per_row * shape[0]; 23 c->buffer = AUBIO_ARRAY(smpl_t, c->size); 24 24 c->data = AUBIO_ARRAY(smpl_t*, shape[0]); 25 c->data[0] = AUBIO_ARRAY(smpl_t, c->size); 26 for (i = 1; i < c->shape[0]; i++) { 27 c->data[i] = c->data[0] + i * items_per_row; 25 for (i = 0; i < c->shape[0]; i++) { 26 c->data[i] = c->buffer + i * items_per_row; 28 27 } 29 28 … … 37 36 void del_aubio_tensor(aubio_tensor_t *c) 38 37 { 39 AUBIO_ASSERT(c);40 38 if (c->data) { 41 39 if (c->data[0]) { … … 44 42 AUBIO_FREE(c->data); 45 43 } 46 //if (c->shape)47 // AUBIO_FREE(c->shape);48 44 AUBIO_FREE(c); 49 45 }
Note: See TracChangeset
for help on using the changeset viewer.