From a097d2a0ed8e30d5aaf6d29ec18d0c39201b7b67 Mon Sep 17 00:00:00 2001 From: Sadik Armagan Date: Wed, 24 Nov 2021 15:47:28 +0000 Subject: IVGCVSW-6453 'Move the ArmNN Test Utils code to a physically separate directory' * Created include/armnnTestUtils directory * Moved Arm NN test utils files into armnnTestUtils directory Signed-off-by: Sadik Armagan Change-Id: I03ac54c645c41c52650c4c03b6a58fb1481fef5d --- .../backendsCommon/test/DataLayoutUtils.hpp | 59 ++-------------------- 1 file changed, 4 insertions(+), 55 deletions(-) (limited to 'src/backends/backendsCommon/test/DataLayoutUtils.hpp') diff --git a/src/backends/backendsCommon/test/DataLayoutUtils.hpp b/src/backends/backendsCommon/test/DataLayoutUtils.hpp index 89b3900979..e920c543f0 100644 --- a/src/backends/backendsCommon/test/DataLayoutUtils.hpp +++ b/src/backends/backendsCommon/test/DataLayoutUtils.hpp @@ -1,60 +1,9 @@ // -// Copyright © 2019 Arm Ltd. All rights reserved. +// Copyright © 2019 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // -#pragma once +#include -#include -#include - -#include - -template -void PermuteTensorNchwToNhwc(armnn::TensorInfo& tensorInfo, std::vector& tensorData) -{ - const armnn::PermutationVector nchwToNhwc = { 0, 3, 1, 2 }; - - tensorInfo = armnnUtils::Permuted(tensorInfo, nchwToNhwc); - - std::vector tmp(tensorData.size()); - armnnUtils::Permute(tensorInfo.GetShape(), nchwToNhwc, tensorData.data(), tmp.data(), sizeof(T)); - tensorData = tmp; -} - -template -void PermuteTensorNhwcToNchw(armnn::TensorInfo& tensorInfo, std::vector& tensorData) -{ - const armnn::PermutationVector nhwcToNchw = { 0, 2, 3, 1 }; - - tensorInfo = armnnUtils::Permuted(tensorInfo, nhwcToNchw); - - std::vector tmp(tensorData.size()); - armnnUtils::Permute(tensorInfo.GetShape(), nhwcToNchw, tensorData.data(), tmp.data(), sizeof(T)); - - tensorData = tmp; -} - -template -void PermuteTensorNdhwcToNcdhw(armnn::TensorInfo& tensorInfo, std::vector& tensorData) -{ - const armnn::PermutationVector ndhwcToNcdhw = { 0, 2, 3, 4, 1 }; - - tensorInfo = armnnUtils::Permuted(tensorInfo, ndhwcToNcdhw); - - std::vector tmp(tensorData.size()); - armnnUtils::Permute(tensorInfo.GetShape(), ndhwcToNcdhw, tensorData.data(), tmp.data(), sizeof(T)); - tensorData = tmp; -} - -template -void PermuteTensorNcdhwToNdhwc(armnn::TensorInfo& tensorInfo, std::vector& tensorData) -{ - const armnn::PermutationVector ncdhwToNdhwc = { 0, 4, 1, 2, 3 }; - - tensorInfo = armnnUtils::Permuted(tensorInfo, ncdhwToNdhwc); - - std::vector tmp(tensorData.size()); - armnnUtils::Permute(tensorInfo.GetShape(), ncdhwToNdhwc, tensorData.data(), tmp.data(), sizeof(T)); - tensorData = tmp; -} +#pragma message("backendsCommon/test/DataLayoutUtils.hpp has been deprecated, it is due for removal " \ + "in 22.08 release. Please use public interface include/armnnTestUtils/DataLayoutUtils.hpp") -- cgit v1.2.1