diff options
author | hakanardo <hakan@debian.org> | 2018-02-16 10:06:34 +0100 |
---|---|---|
committer | Anthony Barbier <Anthony.barbier@arm.com> | 2018-02-16 09:06:34 +0000 |
commit | 292227986edb37b01061afcad6df18ba9d6ccbeb (patch) | |
tree | 9a3986264ce0985da84a1388b03606d9e42ec0af /utils | |
parent | adb2f538210329e2cb26876cdb97643fbca1d657 (diff) | |
download | armcl-292227986edb37b01061afcad6df18ba9d6ccbeb.tar.gz armcl-292227986edb37b01061afcad6df18ba9d6ccbeb.tar.bz2 armcl-292227986edb37b01061afcad6df18ba9d6ccbeb.zip |
Bugfix for NumPyBinLoader with SubTensor output. (#345)
* Bugfix for NumPyBinLoader with SubTensor output.
When a SubTensor is used as output from a NumPyBinLoader, data should
not be written to the begining of the buffer.
Change-Id: I6ed4b24710ac09b41ca92c7e21f24d44a3ed2881
* Reduce the buffer size with the same amount
Change-Id: Id260f58209ce2fbee877f7d6f4afbe95c6c74036
* SubTensor's has to be accessed through execution windows
Diffstat (limited to 'utils')
-rw-r--r-- | utils/GraphUtils.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/utils/GraphUtils.cpp b/utils/GraphUtils.cpp index 2ff40b7fb..f190af488 100644 --- a/utils/GraphUtils.cpp +++ b/utils/GraphUtils.cpp @@ -24,6 +24,7 @@ #include "utils/GraphUtils.h" #include "utils/Utils.h" +#include "arm_compute/runtime/SubTensor.h" #ifdef ARM_COMPUTE_CL #include "arm_compute/core/CL/OpenCL.h" @@ -206,7 +207,7 @@ void RandomAccessor::fill(ITensor &tensor, D &&distribution) { std::mt19937 gen(_seed); - if(tensor.info()->padding().empty()) + if(tensor.info()->padding().empty() && !dynamic_cast<SubTensor*>(&tensor)) { for(size_t offset = 0; offset < tensor.info()->total_size(); offset += tensor.info()->element_size()) { @@ -349,7 +350,7 @@ bool NumPyBinLoader::access_tensor(ITensor &tensor) } // Read data - if(tensor.info()->padding().empty()) + if(tensor.info()->padding().empty() && !dynamic_cast<SubTensor*>(&tensor)) { // If tensor has no padding read directly from stream. stream.read(reinterpret_cast<char *>(tensor.buffer()), tensor.info()->total_size()); |