ONE - On-device Neural Engine
Loading...
Searching...
No Matches
GraphBuilder.h
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
#ifndef __LUCI_IMPORT_GRAPH_BUILDER_H__
18
#define __LUCI_IMPORT_GRAPH_BUILDER_H__
19
20
#include "
GraphBuilderContext.h
"
21
#include "
GraphBuilderBase.h
"
22
23
#include <mio/circle/schema_generated.h>
24
25
namespace
luci
26
{
27
31
class
GraphBuilder
:
public
GraphBuilderBase
32
{
33
public
:
34
virtual
~GraphBuilder
() =
default
;
35
36
// common validate method to check number of inputs and single output
37
bool
validate
(
const
ValidateArgs
&args,
size_t
input_cnt)
const
38
{
39
return
(args.op.inputs.size() == input_cnt && args.op.outputs.size() == 1);
40
}
41
42
CircleNode
*
build
(
const
circle::OperatorT &op,
GraphBuilderContext
*context)
const
final
;
43
44
private
:
45
virtual
CircleNode
*build_node(
const
circle::OperatorT &op,
46
const
std::vector<CircleNode *> &inputs,
47
loco::Graph
*graph)
const
= 0;
48
};
49
50
}
// namespace luci
51
52
#endif
// __LUCI_IMPORT_GRAPH_BUILDER_H__
GraphBuilderBase.h
loco::Graph
A neural network graph.
Definition
Graph.h:161
luci::GraphBuilderContext
Class to store context to build loco graph IR from TensorFlow.
Definition
GraphBuilderContext.h:70
luci::GraphBuilder
Base of general single output graph builder(e.g., Conv2DGraphBuilder)
Definition
GraphBuilder.h:32
luci::GraphBuilder::~GraphBuilder
virtual ~GraphBuilder()=default
luci::GraphBuilder::build
CircleNode * build(const circle::OperatorT &op, GraphBuilderContext *context) const final
Definition
GraphBuilder.cpp:24
luci::GraphBuilder::validate
bool validate(const ValidateArgs &args, size_t input_cnt) const
Definition
GraphBuilder.h:37
luci
Definition
DepthwiseConv2D.h:24
GraphBuilderContext.h
luci::CircleNode
Definition
CircleNodeDecl.h:40
luci::GraphBuilderBase::ValidateArgs
Definition
GraphBuilderBase.h:35
luci::GraphBuilderBase
Interface of convert circle::OperatorT to CircleNode.
Definition
GraphBuilderBase.h:33
compiler
luci
import
include
luci
Import
GraphBuilder.h
Generated by
1.9.8