blob: 66c40139c9b392597687b9caa4e6d7f5a13ff76b [file] [log] [blame]
Narumol Prangnawaratfe6aa2f2021-09-23 16:11:17 +01001//
2// Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "OnnxParserTestUtils.hpp"
7
8#include <fmt/format.h>
9
10namespace armnnUtils
11{
12
13std::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
23std::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