24.02
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
w
Variables
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
w
Enumerations
a
b
c
d
e
f
g
j
l
m
n
o
p
q
r
s
t
u
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
c
d
e
f
i
j
l
m
o
p
r
s
v
w
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
v
w
Enumerations
Enumerator
Related Functions
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
l
m
o
r
s
t
u
v
x
z
Functions
a
b
c
g
i
m
r
s
t
v
z
Variables
Typedefs
Macros
a
c
d
e
f
h
i
l
o
s
t
u
v
x
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
PrototxtConversions.cpp
Go to the documentation of this file.
1
//
2
// Copyright © 2017 Arm Ltd. All rights reserved.
3
// SPDX-License-Identifier: MIT
4
//
5
6
#include "
PrototxtConversions.hpp
"
7
#include "
armnn/Tensor.hpp
"
8
9
#include <iomanip>
10
#include <sstream>
11
#include <string>
12
13
namespace
armnnUtils
14
{
15
16
/// Converts an int value into the Prototxt octal representation
17
std::string
ConvertInt32ToOctalString
(
int
value)
18
{
19
std::stringstream ss;
20
std::string returnString;
21
for
(
int
i = 0; i < 4; ++i)
22
{
23
ss <<
"\\"
;
24
ss << std::setw(3) << std::setfill(
'0'
) << std::oct << ((value >> (i * 8)) & 0xFF);
25
}
26
27
ss >> returnString;
28
return
returnString;
29
}
30
31
/// Converts an TensorShape into Prototxt representation
32
std::string
ConvertTensorShapeToString
(
const
armnn::TensorShape
& shape)
33
{
34
std::stringstream ss;
35
for
(
unsigned
int
i = 0 ; i < shape.
GetNumDimensions
() ; i++)
36
{
37
ss <<
"dim {\n"
;
38
ss <<
"size: "
<< std::to_string(shape[i]) <<
"\n"
;
39
ss <<
"}\n"
;
40
}
41
return
ss.str();
42
43
}
44
}
// namespace armnnUtils
armnnUtils::ConvertTensorShapeToString
std::string ConvertTensorShapeToString(const armnn::TensorShape &shape)
Converts an TensorShape into Prototxt representation.
Definition:
PrototxtConversions.cpp:32
armnn::TensorShape
Definition:
Tensor.hpp:20
armnnUtils::ConvertInt32ToOctalString
std::string ConvertInt32ToOctalString(int value)
Converts an int value into the Prototxt octal representation.
Definition:
PrototxtConversions.cpp:17
armnn::TensorShape::GetNumDimensions
unsigned int GetNumDimensions() const
Function that returns the tensor rank.
Definition:
Tensor.cpp:174
armnnUtils
Definition:
CompatibleTypes.hpp:10
PrototxtConversions.hpp
Tensor.hpp
src
armnnUtils
PrototxtConversions.cpp
Generated on Wed Feb 14 2024 16:36:15 for Arm NN by
1.8.17