ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Common.cpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "Common.h"
18
19std::string mangle(const std::string &name)
20{
21 std::string res = name;
22
23 for (uint32_t n = 0; n < res.size(); ++n)
24 {
25 if (res.at(n) == '/')
26 {
27 res.at(n) = '_';
28 }
29 }
30
31 return res;
32}
33
34std::string value_grpname(void) { return "value"; }
35std::string value_filename(uint32_t n) { return std::to_string(n); }
36
37std::string name_grpname(void) { return "name"; }
38std::string name_filename(uint32_t n) { return std::to_string(n); }
std::string value_grpname(void)
Return the name of "value group".
Definition Common.cpp:34
std::string mangle(const std::string &name)
Construct HDF5-compatible dataset name from a given string.
Definition Common.cpp:19
std::string name_grpname(void)
Return the name of "name group".
Definition Common.cpp:37
std::string name_filename(uint32_t n)
Return the name of n-th tensor attribute.
Definition Common.cpp:38
std::string value_filename(uint32_t n)
Return the name of n-th tensor dataset.
Definition Common.cpp:35