ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Reduce.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 __ONERT_IR_OPERATION_REDUCE_H__
18
#define __ONERT_IR_OPERATION_REDUCE_H__
19
20
#include <memory>
21
22
#include "ir/Operation.h"
23
24
namespace
onert
25
{
26
namespace
ir
27
{
28
namespace
operation
29
{
30
31
class
Reduce
:
public
Operation
32
{
33
public
:
34
enum
Input
35
{
36
INPUT
= 0,
37
AXES
= 1
38
};
39
40
enum class
ReduceType
41
{
42
ALL
,
43
ANY
,
44
MAX
,
45
MEAN
,
46
MIN
,
47
PROD
,
48
SUM
49
};
50
51
struct
Param
52
{
53
ReduceType
reduce_type
;
54
bool
keep_dims
;
55
};
56
57
public
:
58
Reduce
(
const
OperandIndexSequence
&inputs,
const
OperandIndexSequence
&outputs,
59
const
Param
&
param
);
60
61
public
:
62
void
accept
(
OperationVisitor
&v)
const override
;
63
std::string
name
()
const override
;
64
OpCode
opcode
() const final {
return
OpCode::Reduce; }
65
66
public
:
67
const
Param
&
param
()
const
{
return
_param; }
68
69
private
:
70
Param _param;
71
};
72
73
}
// namespace operation
74
}
// namespace ir
75
}
// namespace onert
76
77
#endif
// __ONERT_IR_OPERATION_REDUCE_ALL_H__
onert::ir::OperandIndexSequence
Definition
OperandIndexSequence.h:37
onert::ir::Operation
Definition
Operation.h:34
onert::ir::operation::Reduce
Definition
Reduce.h:32
onert::ir::operation::Reduce::ReduceType
ReduceType
Definition
Reduce.h:41
onert::ir::operation::Reduce::ReduceType::MAX
@ MAX
onert::ir::operation::Reduce::ReduceType::MEAN
@ MEAN
onert::ir::operation::Reduce::ReduceType::ALL
@ ALL
onert::ir::operation::Reduce::ReduceType::SUM
@ SUM
onert::ir::operation::Reduce::ReduceType::ANY
@ ANY
onert::ir::operation::Reduce::ReduceType::PROD
@ PROD
onert::ir::operation::Reduce::ReduceType::MIN
@ MIN
onert::ir::operation::Reduce::opcode
OpCode opcode() const final
Definition
Reduce.h:64
onert::ir::operation::Reduce::name
std::string name() const override
Definition
Reduce.cc:37
onert::ir::operation::Reduce::param
const Param & param() const
Definition
Reduce.h:67
onert::ir::operation::Reduce::accept
void accept(OperationVisitor &v) const override
Definition
Reduce.cc:29
onert::ir::operation::Reduce::Input
Input
Definition
Reduce.h:35
onert::ir::operation::Reduce::AXES
@ AXES
Definition
Reduce.h:37
onert::ir::operation::Reduce::INPUT
@ INPUT
Definition
Reduce.h:36
onert::ir::OpCode
OpCode
Definition
OpCode.h:30
onert
Definition
CustomKernel.cc:20
onert::ir::OperationVisitor
Definition
OperationVisitor.h:28
onert::ir::operation::Reduce::Param
Definition
Reduce.h:52
onert::ir::operation::Reduce::Param::reduce_type
ReduceType reduce_type
Definition
Reduce.h:53
onert::ir::operation::Reduce::Param::keep_dims
bool keep_dims
Definition
Reduce.h:54
runtime
onert
core
include
ir
operation
Reduce.h
Generated by
1.9.8