diff options
author | 오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com> | 2019-04-01 11:08:47 +0900 |
---|---|---|
committer | GitHub Enterprise <noreply-CODE@samsung.com> | 2019-04-01 11:08:47 +0900 |
commit | bcf5b65109a6427d0d41adb6f2b995e0520dd2f5 (patch) | |
tree | ce9f24633fd3a60a84ddcb35cc901404c9ffe753 /runtimes | |
parent | ea05bea3b9c13e0a5ca8a101a33a3f1f163edb0d (diff) | |
download | nnfw-bcf5b65109a6427d0d41adb6f2b995e0520dd2f5.tar.gz nnfw-bcf5b65109a6427d0d41adb6f2b995e0520dd2f5.tar.bz2 nnfw-bcf5b65109a6427d0d41adb6f2b995e0520dd2f5.zip |
Add assertion for cpu backend shape conversion (#4904)
CPU backend assume that neurun's internal shape is always same or less than 4.
It is true on current neurun implementation, but it may change.
So add assertion to check this.
Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
Diffstat (limited to 'runtimes')
-rw-r--r-- | runtimes/neurun/backend/cpu/kernel/OperationUtils.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/runtimes/neurun/backend/cpu/kernel/OperationUtils.cc b/runtimes/neurun/backend/cpu/kernel/OperationUtils.cc index c01770abd..db59fa801 100644 --- a/runtimes/neurun/backend/cpu/kernel/OperationUtils.cc +++ b/runtimes/neurun/backend/cpu/kernel/OperationUtils.cc @@ -195,6 +195,9 @@ Shape getShape(const ::neurun::model::operand::Object &o) shape.scale = o.typeInfo().scale(); shape.offset = o.typeInfo().offset(); + // CPU backend assume that neurun internal shape's rank is always same or less than 4 + assert(shape.dimensions.size() <= 4); + return shape; } |