blob: fc2f51061cba04498301d699259e6cf7bd18b4be [file] [log] [blame]
Nina Drozdd41b2592018-11-19 13:03:36 +00001//
Matteo Martincighe011d202019-11-28 11:35:47 +00002// Copyright © 2019 Arm Ltd. All rights reserved.
Nina Drozdd41b2592018-11-19 13:03:36 +00003// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
8#include <armnn/TypesUtils.hpp>
9
10namespace armnnUtils
11{
12armnn::TensorShape GetTensorShape(unsigned int numberOfBatches,
13 unsigned int numberOfChannels,
14 unsigned int height,
15 unsigned int width,
16 const armnn::DataLayout dataLayout);
17
Nina Drozdd41b2592018-11-19 13:03:36 +000018armnn::TensorInfo GetTensorInfo(unsigned int numberOfBatches,
19 unsigned int numberOfChannels,
20 unsigned int height,
21 unsigned int width,
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +000022 const armnn::DataLayout dataLayout,
23 const armnn::DataType dataType);
24
Tamás Nyíri7b885b32021-10-26 14:47:57 +010025armnn::TensorInfo GetTensorInfo(unsigned int numberOfBatches,
26 unsigned int numberOfChannels,
27 unsigned int depth,
28 unsigned int height,
29 unsigned int width,
30 const armnn::DataLayout dataLayout,
31 const armnn::DataType dataType);
32
Jim Flynnf92dfce2019-05-02 11:33:25 +010033std::pair<float, float> FindMinMax(armnn::ITensorHandle* tensorHandle);
34
Narumol Prangnawarat02807852019-09-11 16:43:09 +010035armnn::TensorShape ExpandDims(const armnn::TensorShape& tensorShape, int axis);
36
Mike Kelly80512b02022-05-16 23:10:42 +010037std::vector<unsigned int> SqueezeDims(const armnn::TensorShape& tensorShape);
38
Narumol Prangnawarat4dc64a62019-09-16 17:00:22 +010039unsigned int GetNumElementsBetween(const armnn::TensorShape& shape,
40 unsigned int firstAxisInclusive,
41 unsigned int lastAxisExclusive);
42
43unsigned int GetUnsignedAxis(const unsigned int inputDimension, const int axis);
44
Aron Virginas-Tarb67f9572019-11-04 15:00:19 +000045unsigned int GetNumElementsAfter(const armnn::TensorShape& shape, unsigned int axis);
Keith Davis5236e1d2019-11-04 08:58:33 +000046
Aron Virginas-Tarb67f9572019-11-04 15:00:19 +000047std::pair<unsigned int, std::vector<float>> GetPerAxisParams(const armnn::TensorInfo& info);
Keith Davis5236e1d2019-11-04 08:58:33 +000048
Nattapat Chaimanowong649dd952019-01-22 16:10:44 +000049} // namespace armnnUtils