Changeset f5ea4fb


Ignore:
Timestamp:
Jan 2, 2019, 10:53:40 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn_org, feature/crepe_org
Children:
427a48c
Parents:
40520ea
Message:

[tensor] set buffer, remove old comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ai/tensor.c

    r40520ea rf5ea4fb  
    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.