Changeset da7dbd3 for src/ai/tensor.h


Ignore:
Timestamp:
Dec 29, 2021, 5:51:46 PM (3 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe
Children:
7b2a58c
Parents:
2396987
git-author:
Paul Brossier <piem@piem.org> (01/02/19 23:07:16)
git-committer:
Paul Brossier <piem@piem.org> (12/29/21 17:51:46)
Message:

[tensor] add some documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ai/tensor.h

    r2396987 rda7dbd3  
    4949} aubio_tensor_t;
    5050
     51/** create a new tensor
     52
     53  \param ndim   number of dimensions
     54  \param shape  array of dimensions
     55
     56  \return new ::aubio_tensor_t
     57
     58*/
    5159aubio_tensor_t *new_aubio_tensor(uint_t ndim, uint_t *shape);
    5260
     61/** destroy a tensor
     62
     63  \param c  tensor to destroy
     64
     65*/
    5366void del_aubio_tensor(aubio_tensor_t *c);
    5467
     68/** view tensor as a vector
     69
     70  \param c  tensor to view as ::fvec_t
     71  \param o  pointer to use to store view
     72
     73  \return 0 on success, non-zero otherwise
     74
     75*/
    5576uint_t aubio_tensor_as_fvec(aubio_tensor_t *c, fvec_t *o);
     77
     78/** view vector as a tensor
     79
     80  \param o  ::fvec_t to view as a tensor
     81  \param c  pointer to use to store view
     82
     83  \return 0 on success, non-zero otherwise
     84
     85*/
    5686uint_t aubio_fvec_as_tensor(fvec_t *o, aubio_tensor_t *c);
    5787
     88/** view tensor as a matrix
     89
     90  \param c  tensor to view as ::fmat_t
     91  \param o  pointer to use to store view
     92
     93  \return 0 on success, non-zero otherwise
     94
     95*/
    5896uint_t aubio_tensor_as_fmat(aubio_tensor_t *c, fmat_t *o);
     97
     98/** view matrix as a tensor
     99
     100  \param o  ::fmat_t to view as a tensor
     101  \param c  pointer to use to store view
     102
     103  \return 0 on success, non-zero otherwise
     104
     105*/
    59106uint_t aubio_fmat_as_tensor(fmat_t *o, aubio_tensor_t *c);
    60107
     108/** view i-th row of tensor t as a tensor
     109
     110  \param t tensor to get maximum from
     111  \param i index of row to retrieve
     112  \param st subtensor to fill in
     113
     114  \return 0 on success, non-zero otherwise
     115*/
    61116uint_t aubio_tensor_get_subtensor(aubio_tensor_t *t, uint_t i,
    62117        aubio_tensor_t *st);
    63118
     119/** find the maximum value of a tensor
     120
     121  \param t tensor to get maximum from
     122
     123  \return maximum value of all elements in tensor
     124*/
    64125smpl_t aubio_tensor_max(aubio_tensor_t *t);
    65126
     127/** check if sizes of 2 tensor match
     128
     129  \param t  first tensor to check size with
     130  \param s  second tensor to check size with
     131
     132  \return 1 if tensors have the same size, 0 otherwise
     133*/
    66134uint_t aubio_tensor_have_same_size(aubio_tensor_t *t, aubio_tensor_t *s);
    67135
     136/** print the content of a tensor
     137
     138  \param t  tensor to print
     139
     140 */
    68141void aubio_tensor_print(aubio_tensor_t *t);
    69142
     143/** get a string representing the dimensions of this tensor
     144
     145  \param t  tensor to get shape string from
     146
     147  \return string of characters containing the dimensions of t
     148*/
    70149const char_t *aubio_tensor_get_shape_string(aubio_tensor_t *t);
    71150
Note: See TracChangeset for help on using the changeset viewer.