ONE - On-device Neural Engine
Loading...
Searching...
No Matches
mir2loco.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2019 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 "
mir/Graph.h
"
18
#include "
mir/Visitor.h
"
19
#include "
loco.h
"
20
21
namespace
mir2loco
22
{
23
24
class
Transformer
final :
public
mir::Visitor
25
{
26
public
:
27
Transformer
() =
default
;
28
~Transformer
() =
default
;
29
30
void
visit
(
mir::ops::AddOp
&op)
override
;
31
void
visit
(
mir::ops::AvgPool2DOp
&op)
override
;
32
void
visit
(
mir::ops::ConcatOp
&op)
override
;
33
void
visit
(
mir::ops::ConstantOp
&op)
override
;
34
void
visit
(
mir::ops::Conv2DOp
&op)
override
;
35
void
visit
(
mir::ops::DeConv2DOp
&op)
override
;
36
void
visit
(
mir::ops::DepthwiseConv2DOp
&op)
override
;
37
void
visit
(
mir::ops::DivOp
&op)
override
;
38
void
visit
(
mir::ops::FullyConnectedOp
&op)
override
;
39
void
visit
(
mir::ops::InputOp
&op)
override
;
40
void
visit
(
mir::ops::MaxPool2DOp
&op)
override
;
41
void
visit
(
mir::ops::MulOp
&op)
override
;
42
void
visit
(
mir::ops::OutputOp
&op)
override
;
43
void
visit
(
mir::ops::ReluOp
&op)
override
;
44
void
visit
(
mir::ops::ReshapeOp
&op)
override
;
45
void
visit
(
mir::ops::SoftmaxOp
&op)
override
;
46
void
visit
(
mir::ops::SubOp
&op)
override
;
47
void
visit
(
mir::ops::TransposeOp
&op)
override
;
48
49
void
visit_fallback
(
mir::Operation
&op)
override
;
50
51
std::unique_ptr<loco::Graph>
transform
(
mir::Graph
*mir_graph);
52
53
private
:
54
std::unique_ptr<loco::Graph> _loco_graph;
55
std::unordered_map<mir::Operation::Output *, loco::Node *> _mir2loco_map;
56
};
57
58
}
// namespace mir2loco
mir2loco::Transformer
Definition
mir2loco.h:25
mir2loco::Transformer::visit
void visit(mir::ops::AddOp &op) override
Definition
mir2loco.cpp:266
mir2loco::Transformer::Transformer
Transformer()=default
mir2loco::Transformer::~Transformer
~Transformer()=default
mir2loco::Transformer::transform
std::unique_ptr< loco::Graph > transform(mir::Graph *mir_graph)
Definition
mir2loco.cpp:710
mir2loco::Transformer::visit_fallback
void visit_fallback(mir::Operation &op) override
Definition
mir2loco.cpp:708
mir::Graph
Definition
Graph.h:35
mir::Operation
Definition
Operation.h:33
mir::Visitor
Base visitor with empty fallback function.
Definition
Visitor.h:51
mir::ops::AddOp
Definition
AddOp.h:28
mir::ops::AvgPool2DOp
Definition
AvgPool2DOp.h:32
mir::ops::ConcatOp
Description of tensor concatenation operation.
Definition
ConcatOp.h:31
mir::ops::ConstantOp
Definition
ConstantOp.h:29
mir::ops::Conv2DOp
Definition
Conv2DOp.h:30
mir::ops::DeConv2DOp
Definition
Deconv2DOp.h:33
mir::ops::DepthwiseConv2DOp
Definition
DepthwiseConv2DOp.h:30
mir::ops::DivOp
Definition
DivOp.h:28
mir::ops::FullyConnectedOp
Definition
FullyConnectedOp.h:29
mir::ops::InputOp
Definition
InputOp.h:28
mir::ops::MaxPool2DOp
Definition
MaxPool2DOp.h:32
mir::ops::MulOp
Definition
MulOp.h:28
mir::ops::OutputOp
Definition
OutputOp.h:28
mir::ops::ReluOp
Definition
ReluOp.h:28
mir::ops::ReshapeOp
Definition
ReshapeOp.h:28
mir::ops::SoftmaxOp
description of softmax operation.
Definition
SoftmaxOp.h:31
mir::ops::SubOp
Definition
SubOp.h:28
mir::ops::TransposeOp
Tensor transpose operation.
Definition
TransposeOp.h:34
Graph.h
loco.h
Visitor.h
mir2loco
Definition
mir2loco.h:22
compiler
mir2loco
include
mir2loco.h
Generated by
1.9.8