Changeset b508ba6 for src/ai/tensor.h


Ignore:
Timestamp:
Dec 29, 2021, 5:51:45 PM (3 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe
Children:
f4c5a95
Parents:
e181d64
git-author:
Paul Brossier <piem@piem.org> (01/01/19 18:38:05)
git-committer:
Paul Brossier <piem@piem.org> (12/29/21 17:51:45)
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ai/tensor.h

    re181d64 rb508ba6  
    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.