ONE - On-device Neural Engine
Loading...
Searching...
No Matches
ElementwiseBinary.cc
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 "
ir/operation/ElementwiseBinary.h
"
18
#include "
ir/OperationVisitor.h
"
19
20
#include <unordered_map>
21
22
namespace
onert::ir::operation
23
{
24
25
void
ElementwiseBinary::accept
(
OperationVisitor
&v)
const
{ v.visit(*
this
); }
26
27
ElementwiseBinary::ElementwiseBinary
(
const
OperandIndexSequence
&inputs,
28
const
OperandIndexSequence
&outputs,
const
Param
¶m)
29
:
Operation
{
OperandConstraint
::createExact(2u), inputs, outputs}, _param{param}
30
{
31
}
32
33
std::string
ElementwiseBinary::name
()
const
34
{
35
using
ElementwiseBinaryType
=
onert::ir::operation::ElementwiseBinary::ElementwiseBinaryType
;
36
static
const
std::unordered_map<ElementwiseBinaryType, std::string> name_map{
37
{
ElementwiseBinaryType::FLOOR_DIV
, std::string{
"FloorDiv"
}},
38
{
ElementwiseBinaryType::FLOOR_MOD
, std::string{
"FloorMod"
}},
39
{
ElementwiseBinaryType::LOGICAL_AND
, std::string{
"LogicalAnd"
}},
40
{
ElementwiseBinaryType::LOGICAL_OR
, std::string{
"LogicalOr"
}},
41
{
ElementwiseBinaryType::MAX
, std::string{
"Max"
}},
42
{
ElementwiseBinaryType::MIN
, std::string{
"Min"
}}};
43
return
name_map.at(_param.
op_type
);
44
}
45
46
}
// namespace onert::ir::operation
ElementwiseBinary.h
OperationVisitor.h
onert::ir::OperandConstraint
Definition
OperandConstraint.h:28
onert::ir::OperandIndexSequence
Definition
OperandIndexSequence.h:35
onert::ir::Operation
Definition
Operation.h:32
onert::ir::operation::ElementwiseBinary::name
std::string name() const override
Definition
ElementwiseBinary.cc:33
onert::ir::operation::ElementwiseBinary::ElementwiseBinaryType
ElementwiseBinaryType
Definition
ElementwiseBinary.h:35
onert::ir::operation::ElementwiseBinary::ElementwiseBinaryType::LOGICAL_OR
@ LOGICAL_OR
onert::ir::operation::ElementwiseBinary::ElementwiseBinaryType::MAX
@ MAX
onert::ir::operation::ElementwiseBinary::ElementwiseBinaryType::FLOOR_DIV
@ FLOOR_DIV
onert::ir::operation::ElementwiseBinary::ElementwiseBinaryType::LOGICAL_AND
@ LOGICAL_AND
onert::ir::operation::ElementwiseBinary::ElementwiseBinaryType::FLOOR_MOD
@ FLOOR_MOD
onert::ir::operation::ElementwiseBinary::ElementwiseBinaryType::MIN
@ MIN
onert::ir::operation::ElementwiseBinary::ElementwiseBinary
ElementwiseBinary(const OperandIndexSequence &inputs, const OperandIndexSequence &outputs, const Param ¶m)
Definition
ElementwiseBinary.cc:27
onert::ir::operation::ElementwiseBinary::accept
void accept(OperationVisitor &v) const override
Definition
ElementwiseBinary.cc:25
onert::ir::operation
Definition
AddN.h:23
onert::ir::OperationVisitor
Definition
OperationVisitor.h:26
onert::ir::operation::ElementwiseBinary::Param
Definition
ElementwiseBinary.h:45
onert::ir::operation::ElementwiseBinary::Param::op_type
ElementwiseBinaryType op_type
Definition
ElementwiseBinary.h:46
runtime
onert
core
src
ir
operation
ElementwiseBinary.cc
Generated by
1.9.8