projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
45a28ea
)
[tensor] have_same_shape returns false on null pointers
author
Paul Brossier
<piem@piem.org>
Tue, 29 Jan 2019 02:14:39 +0000
(
03:14
+0100)
committer
Paul Brossier
<piem@piem.org>
Tue, 29 Jan 2019 02:14:39 +0000
(
03:14
+0100)
src/ai/tensor.c
patch
|
blob
|
history
diff --git
a/src/ai/tensor.c
b/src/ai/tensor.c
index
8f196a3
..
976706a
100644
(file)
--- a/
src/ai/tensor.c
+++ b/
src/ai/tensor.c
@@
-140,10
+140,11
@@
uint_t aubio_tensor_get_subtensor(aubio_tensor_t *t, uint_t i,
uint_t aubio_tensor_have_same_shape(aubio_tensor_t *a, aubio_tensor_t *b)
{
uint_t n;
- AUBIO_ASSERT(a && b);
- if (a->ndim != b->ndim) {
+ if (!a || !b)
return 0;
- }
+ if (a->ndim != b->ndim)
+ return 0;
+
for (n = 0; n < a->ndim; n++) {
if (a->shape[n] != b->shape[n]) {
return 0;