ArmNN
 22.08
OnnxParserTestUtils.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 #include <fmt/format.h>
9 
10 namespace armnnUtils
11 {
12 
13 std::string ConstructTensorShapeString(const std::vector<int>& shape)
14 {
15  std::string shapeStr;
16  for (int i : shape)
17  {
18  shapeStr = fmt::format("{} dim {{ dim_value: {} }}", shapeStr, i);
19  }
20  return shapeStr;
21 }
22 
23 std::string ConstructIntsAttribute(const std::string& name,
24  const std::vector<int>& values)
25 {
26  std::string attrString = fmt::format("attribute {{ name: '{}'", name);;
27  for (int i : values)
28  {
29  attrString = fmt::format(" {} ints: {}", attrString, i);
30  }
31  attrString = fmt::format(" {} type: INTS }}", attrString);
32  return attrString;
33 }
34 
35 } // namespace armnnUtils
std::string ConstructTensorShapeString(const std::vector< int > &shape)
std::string ConstructIntsAttribute(const std::string &name, const std::vector< int > &values)