ONE - On-device Neural Engine
Loading...
Searching...
No Matches
GraphBuilderContext.cpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 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
18
19#include <luci/Log.h>
20
21#include <oops/UserExn.h>
22
23namespace luci
24{
25
27{
28 auto iter = _table.find(idx);
29 if (iter != _table.end())
30 {
31 LOGGER(l);
32 INFO(l) << "[luci] NodeFinder SKIP (" << idx << ") " << node << ":" << node->name()
33 << " existing: " << iter->second << ":" << iter->second->name() << std::endl;
34 return;
35 }
36
37 _table[idx] = node;
38}
39
41{
42 MapIndexNode_t::const_iterator iter = _table.find(idx);
43
44 // dangle output node may exist that are not enrolled
45 return (iter != _table.end()) ? iter->second : nullptr;
46}
47
49{
50 auto iter = _set.find(idx);
51 if (iter != _set.end())
52 {
53 LOGGER(l);
54 INFO(l) << "[luci] TensorOutputs SKIP (" << idx << ") existing" << std::endl;
55 return;
56 }
57 _set.insert(idx);
58}
59
60bool IndexTensorOutputs::find(TensorIndex idx) { return (_set.find(idx) != _set.end()); }
61
62} // namespace luci
#define LOGGER(name)
Definition Log.h:65
#define INFO(name)
Definition Log.h:68
void enroll(TensorIndex idx, CircleNode *node)
CircleNode * node(TensorIndex idx) const
void enroll(TensorIndex idx)
int32_t TensorIndex
NodeName name(void) const