ONE - On-device Neural Engine
Loading...
Searching...
No Matches
CircleNodes.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
17#include "luci/IR/CircleNodes.h"
18
19#include "Check.h"
20
21#include <loco.h>
22
23namespace luci
24{
25
26void link(loco::GraphOutput *output, CircleOutput *node) { node->index(output->index()); }
27
29{
30 for (uint32_t n = 0; n < g->nodes()->size(); ++n)
31 {
32 if (auto output = dynamic_cast<CircleOutput *>(g->nodes()->at(n)))
33 {
34 if (output->indexed() && output->index() == index)
35 {
36 return output;
37 }
38 }
39 }
40 return nullptr;
41}
42
43void link(loco::GraphInput *input, CircleInput *node) { node->index(input->index()); }
44
46{
47 for (uint32_t n = 0; n < g->nodes()->size(); ++n)
48 {
49 if (auto input = dynamic_cast<CircleInput *>(g->nodes()->at(n)))
50 {
51 if (input->indexed() && input->index() == index)
52 {
53 return input;
54 }
55 }
56 }
57 return nullptr;
58}
59
60} // namespace luci
A neural network graph.
Definition Graph.h:161
Graph-level Input Metadata.
Definition Graph.h:107
Graph-level Output Metadata.
Definition Graph.h:135
CircleNode used for Input of the Graph.
Definition CircleInput.h:36
void index(const loco::GraphInputIndex &index)
CircleNode for Output of the Graph.
void index(const loco::GraphOutputIndex &index)
uint32_t GraphInputIndex
uint32_t GraphOutputIndex
CircleOutput * output_node(loco::Graph *g, const loco::GraphOutputIndex &index)
Find a CircleOutput node with a given output index.
CircleInput * input_node(loco::Graph *g, const loco::GraphInputIndex &index)
Find a Pull node with a given input index.
void link(loco::GraphOutput *, CircleOutput *)
Link GraphOutput with CircleOutput node.
int32_t size[5]
Definition Slice.cpp:35