projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9ca7923
)
[tensor] also set size when viewing fmat/fvec
author
Paul Brossier
<piem@piem.org>
Wed, 2 Jan 2019 01:10:48 +0000
(
02:10
+0100)
committer
Paul Brossier
<piem@piem.org>
Wed, 2 Jan 2019 01:10:48 +0000
(
02:10
+0100)
src/ai/tensor.c
patch
|
blob
|
history
diff --git
a/src/ai/tensor.c
b/src/ai/tensor.c
index
097ee22
..
60239a1
100644
(file)
--- a/
src/ai/tensor.c
+++ b/
src/ai/tensor.c
@@
-61,6
+61,7
@@
uint_t aubio_fvec_as_tensor(fvec_t *o, aubio_tensor_t *c) {
c->ndim = 1;
c->shape[0] = o->length;
c->data = &o->data;
+ c->size = o->length;
return AUBIO_OK;
}
@@
-80,6
+81,7
@@
uint_t aubio_fmat_as_tensor(fmat_t *o, aubio_tensor_t *c) {
c->ndim = 2;
c->shape[0] = o->height;
c->shape[1] = o->length;
+ c->size = o->height * o->length;
c->data = o->data;
return AUBIO_OK;
}