This patch allows 0 value dimension in setDimension function.
Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
}
for (int dim : dimension) {
- if (dim <= 0) {
+ if (dim < 0) {
throw new IllegalArgumentException("The dimension should be a positive value");
}
}
/* fill default value */
for (int i = rank; i < NNStreamer.TENSOR_RANK_LIMIT; i++) {
- this.dimension[i] = 1;
+ this.dimension[i] = 0;
}
}
}
for (int i = 0; i < NNStreamer.TENSOR_RANK_LIMIT; i++) {
+ if (this.dimension[i] == 0)
+ break;
size *= this.dimension[i];
}