Changeset 2859f89


Ignore:
Timestamp:
Dec 29, 2021, 5:51:46 PM (2 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe
Children:
0d9ef90
Parents:
d3d72b7
git-author:
Paul Brossier <piem@piem.org> (01/02/19 22:53:40)
git-committer:
Paul Brossier <piem@piem.org> (12/29/21 17:51:46)
Message:

[tensor] set buffer, remove old comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ai/tensor.c

    rd3d72b7 r2859f89  
    66{
    77  aubio_tensor_t *c = AUBIO_NEW(aubio_tensor_t);
     8  uint_t items_per_row = 1;
    89  uint_t i;
    910
     
    1415
    1516  c->ndim = ndim;
    16   uint_t items_per_row = 1;
    17   //c->shape = AUBIO_ARRAY(uint_t, ndim);
    1817  c->shape[0] = shape[0];
    1918  for (i = 1; i < ndim; i++) {
     
    2221  }
    2322  c->size = items_per_row * shape[0];
     23  c->buffer = AUBIO_ARRAY(smpl_t, c->size);
    2424  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;
    2827  }
    2928
     
    3736void del_aubio_tensor(aubio_tensor_t *c)
    3837{
    39   AUBIO_ASSERT(c);
    4038  if (c->data) {
    4139    if (c->data[0]) {
     
    4442    AUBIO_FREE(c->data);
    4543  }
    46   //if (c->shape)
    47   //  AUBIO_FREE(c->shape);
    4844  AUBIO_FREE(c);
    4945}
Note: See TracChangeset for help on using the changeset viewer.