diff options
author | Pablo Tello <pablo.tello@arm.com> | 2018-11-15 14:43:10 +0000 |
---|---|---|
committer | Anthony Barbier <Anthony.barbier@arm.com> | 2018-11-19 09:58:20 +0000 |
commit | 32521430ad67172d372721979e8a32b7d4317620 (patch) | |
tree | c18921290341c1d730fbff406960dc7ea7f61306 /utils/Utils.h | |
parent | d696cb6d18c2fe66f1abce88bbd14faf2137ef89 (diff) | |
download | ComputeLibrary-32521430ad67172d372721979e8a32b7d4317620.tar.gz |
COMPMID-1750: Add PriorBox operator to graph API.
Change-Id: I5d2ed5dcc342abff8124762f7bdee587cdf20032
Diffstat (limited to 'utils/Utils.h')
-rw-r--r-- | utils/Utils.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/Utils.h b/utils/Utils.h index 92ab1a30b9..8cac857178 100644 --- a/utils/Utils.h +++ b/utils/Utils.h @@ -607,7 +607,6 @@ void save_to_ppm(T &tensor, const std::string &ppm_filename) /** Template helper function to save a tensor image to a NPY file. * * @note Only F32 data type supported. - * @note Only works with 2D tensors. * @note If the input tensor is a CLTensor, the function maps and unmaps the image * * @param[in] tensor The tensor to save as NPY file @@ -627,9 +626,9 @@ void save_to_npy(T &tensor, const std::string &npy_filename, bool fortran_order) std::vector<npy::ndarray_len_t> shape(tensor.info()->num_dimensions()); - for(unsigned int i = 0; i < tensor.info()->num_dimensions(); ++i) + for(unsigned int i = 0, j = tensor.info()->num_dimensions() - 1; i < tensor.info()->num_dimensions(); ++i, --j) { - shape[i] = tensor.info()->tensor_shape()[i]; + shape[i] = tensor.info()->tensor_shape()[!fortran_order ? j : i]; } // Map buffer if creating a CLTensor @@ -802,12 +801,13 @@ int compare_tensor(ITensor &tensor1, ITensor &tensor2) map(tensor1, true); map(tensor2, true); + Iterator itensor1(&tensor1, window); Iterator itensor2(&tensor2, window); execute_window_loop(window, [&](const Coordinates & id) { - if(std::abs(*reinterpret_cast<T *>(itensor1.ptr()) - *reinterpret_cast<T *>(itensor2.ptr())) > 0.00001) + if(std::abs(*reinterpret_cast<T *>(itensor1.ptr()) - *reinterpret_cast<T *>(itensor2.ptr())) > 0.0001) { ++num_mismatches; } |