Changeset dc257cc for src/ai/tensor.c


Ignore:
Timestamp:
Jan 2, 2019, 10:57:49 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn_org, feature/crepe_org
Children:
c4b6b59
Parents:
7e0b641
Message:

[tensor] add have_same_size

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ai/tensor.c

    r7e0b641 rdc257cc  
    111111}
    112112
     113uint_t aubio_tensor_have_same_size(aubio_tensor_t *t, aubio_tensor_t *s)
     114{
     115  uint_t n;
     116  if (!t || !s) return 0;
     117  if (t->ndim != s->ndim) return 0;
     118  if (t->size != s->size) return 0;
     119  n = t->ndim;
     120  while (n--) {
     121    if (t->shape[n] != s->shape[n]) {
     122      return 0;
     123    }
     124  }
     125  return 1;
     126}
     127
    113128smpl_t aubio_tensor_max(aubio_tensor_t *t)
    114129{
Note: See TracChangeset for help on using the changeset viewer.