Nina Drozd | d41b259 | 2018-11-19 13:03:36 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include <armnn/TypesUtils.hpp> |
| 9 | |
Keith Davis | 5236e1d | 2019-11-04 08:58:33 +0000 | [diff] [blame] | 10 | #include <boost/assert.hpp> |
| 11 | |
Nina Drozd | d41b259 | 2018-11-19 13:03:36 +0000 | [diff] [blame] | 12 | namespace armnnUtils |
| 13 | { |
| 14 | armnn::TensorShape GetTensorShape(unsigned int numberOfBatches, |
| 15 | unsigned int numberOfChannels, |
| 16 | unsigned int height, |
| 17 | unsigned int width, |
| 18 | const armnn::DataLayout dataLayout); |
| 19 | |
Nina Drozd | d41b259 | 2018-11-19 13:03:36 +0000 | [diff] [blame] | 20 | armnn::TensorInfo GetTensorInfo(unsigned int numberOfBatches, |
| 21 | unsigned int numberOfChannels, |
| 22 | unsigned int height, |
| 23 | unsigned int width, |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 24 | const armnn::DataLayout dataLayout, |
| 25 | const armnn::DataType dataType); |
| 26 | |
Jim Flynn | f92dfce | 2019-05-02 11:33:25 +0100 | [diff] [blame] | 27 | std::pair<float, float> FindMinMax(armnn::ITensorHandle* tensorHandle); |
| 28 | |
Narumol Prangnawarat | 0280785 | 2019-09-11 16:43:09 +0100 | [diff] [blame] | 29 | armnn::TensorShape ExpandDims(const armnn::TensorShape& tensorShape, int axis); |
| 30 | |
Narumol Prangnawarat | 4dc64a6 | 2019-09-16 17:00:22 +0100 | [diff] [blame] | 31 | unsigned int GetNumElementsBetween(const armnn::TensorShape& shape, |
| 32 | unsigned int firstAxisInclusive, |
| 33 | unsigned int lastAxisExclusive); |
| 34 | |
| 35 | unsigned int GetUnsignedAxis(const unsigned int inputDimension, const int axis); |
| 36 | |
Aron Virginas-Tar | b67f957 | 2019-11-04 15:00:19 +0000 | [diff] [blame] | 37 | unsigned int GetNumElementsAfter(const armnn::TensorShape& shape, unsigned int axis); |
Keith Davis | 5236e1d | 2019-11-04 08:58:33 +0000 | [diff] [blame] | 38 | |
Aron Virginas-Tar | b67f957 | 2019-11-04 15:00:19 +0000 | [diff] [blame] | 39 | std::pair<unsigned int, std::vector<float>> GetPerAxisParams(const armnn::TensorInfo& info); |
Keith Davis | 5236e1d | 2019-11-04 08:58:33 +0000 | [diff] [blame] | 40 | |
Nattapat Chaimanowong | 649dd95 | 2019-01-22 16:10:44 +0000 | [diff] [blame] | 41 | } // namespace armnnUtils |