Changeset 5010e61 for src/ai/tensor.h


Ignore:
Timestamp:
Jan 1, 2019, 6:38:05 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn_org, feature/crepe_org
Children:
6e4ef27
Parents:
d0ef4b7
Message:

[tensor] rename attributes to ndim and shape[] to match numpy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ai/tensor.h

    rd0ef4b7 r5010e61  
    2727
    2828typedef struct {
    29   uint_t n_dims;
    30   uint_t dims[8];
     29  uint_t ndim;
     30  uint_t shape[8];
    3131  smpl_t **data;
    3232  uint_t n_items;
     
    3434} aubio_tensor_t;
    3535
    36 aubio_tensor_t *new_aubio_tensor(uint_t n_dims, uint_t *dims);
     36aubio_tensor_t *new_aubio_tensor(uint_t ndim, uint_t *shape);
    3737
    3838void del_aubio_tensor(aubio_tensor_t *c);
     
    4848#define AUBIO_ASSERT_EQUAL_SHAPE(t1, t2) { \
    4949    AUBIO_ASSERT(t1 && t2); \
    50     AUBIO_ASSERT(t1->n_dims == t2->n_dims); \
     50    AUBIO_ASSERT(t1->ndim == t2->ndim); \
    5151    uint_t nn; \
    52     for (nn = 0; nn < t1->n_dims; nn++) \
    53       AUBIO_ASSERT(t1->dims[nn] == t2->dims[nn]); \
     52    for (nn = 0; nn < t1->ndim; nn++) \
     53      AUBIO_ASSERT(t1->shape[nn] == t2->shape[nn]); \
    5454    }
    5555
Note: See TracChangeset for help on using the changeset viewer.