ONE - On-device Neural Engine
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
w
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
i
k
l
m
n
o
p
q
r
s
t
u
Enumerator
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
u
v
w
y
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerations
a
c
d
e
f
g
i
k
l
m
o
p
r
s
t
w
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Related Symbols
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
Variables
_
b
c
d
f
g
i
k
m
n
o
p
s
t
v
Typedefs
a
d
f
g
i
l
m
n
o
s
t
u
v
Enumerations
f
g
n
o
p
r
Enumerator
a
k
n
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
ElementwiseActivationLayer.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_BACKEND_CPU_OPS_ElementwiseActivationLAYER_H__
18
#define __ONERT_BACKEND_CPU_OPS_ElementwiseActivationLAYER_H__
19
20
#include <
backend/IPortableTensor.h
>
21
22
#include <
exec/IFunction.h
>
23
24
namespace
onert::backend::cpu::ops
25
{
26
27
enum class
ElementwiseActivationType
28
{
29
kElu
,
30
kLogistic
,
31
kReLU
,
32
kTanh
,
33
kLeakyReLU
,
34
kGELU
35
};
27
enum class
ElementwiseActivationType
{
…
};
36
37
class
ElementwiseActivationLayer
:
public
::onert::exec::IFunction
38
{
39
public
:
40
ElementwiseActivationLayer
();
41
42
public
:
43
void
configure
(
const
IPortableTensor
*input,
IPortableTensor
*output,
float
alpha,
float
beta,
44
bool
approximate,
const
ElementwiseActivationType
op_type);
45
46
void
run
()
override
;
47
48
void
PopulateLookupTable
(
const
ElementwiseActivationType
op_type);
49
50
void
EvalUsingLookupTable
(
const
IPortableTensor
*input,
IPortableTensor
*output);
51
52
protected
:
53
const
IPortableTensor
*
_input
;
54
IPortableTensor
*
_output
;
55
uint8_t
_table
[256];
56
std::function<void(
const
IPortableTensor
*input,
IPortableTensor
*output)>
_kernel
;
57
};
37
class
ElementwiseActivationLayer
:
public
::onert::exec::IFunction
{
…
};
58
59
}
// namespace onert::backend::cpu::ops
60
61
#endif
// __ONERT_BACKEND_CPU_OPS_ElementwiseActivationLAYER_H__
IFunction.h
IPortableTensor.h
onert::backend::IPortableTensor
A tensor class that is portable for other backends.
Definition
IPortableTensor.h:37
onert::backend::cpu::ops::ElementwiseActivationLayer
Definition
ElementwiseActivationLayer.h:38
onert::backend::cpu::ops::ElementwiseActivationLayer::_table
uint8_t _table[256]
Definition
ElementwiseActivationLayer.h:55
onert::backend::cpu::ops::ElementwiseActivationLayer::PopulateLookupTable
void PopulateLookupTable(const ElementwiseActivationType op_type)
Definition
ElementwiseActivationLayer.cc:38
onert::backend::cpu::ops::ElementwiseActivationLayer::ElementwiseActivationLayer
ElementwiseActivationLayer()
Definition
ElementwiseActivationLayer.cc:32
onert::backend::cpu::ops::ElementwiseActivationLayer::_kernel
std::function< void(const IPortableTensor *input, IPortableTensor *output)> _kernel
Definition
ElementwiseActivationLayer.h:56
onert::backend::cpu::ops::ElementwiseActivationLayer::configure
void configure(const IPortableTensor *input, IPortableTensor *output, float alpha, float beta, bool approximate, const ElementwiseActivationType op_type)
Definition
ElementwiseActivationLayer.cc:82
onert::backend::cpu::ops::ElementwiseActivationLayer::EvalUsingLookupTable
void EvalUsingLookupTable(const IPortableTensor *input, IPortableTensor *output)
Definition
ElementwiseActivationLayer.cc:69
onert::backend::cpu::ops::ElementwiseActivationLayer::_input
const IPortableTensor * _input
Definition
ElementwiseActivationLayer.h:53
onert::backend::cpu::ops::ElementwiseActivationLayer::run
void run() override
Definition
ElementwiseActivationLayer.cc:202
onert::backend::cpu::ops::ElementwiseActivationLayer::_output
IPortableTensor * _output
Definition
ElementwiseActivationLayer.h:54
onert::exec::IFunction
Definition
IFunction.h:24
onert::backend::cpu::ops
Definition
AddNLayer.cc:25
onert::backend::cpu::ops::ElementwiseActivationType
ElementwiseActivationType
Definition
ElementwiseActivationLayer.h:28
onert::backend::cpu::ops::ElementwiseActivationType::kElu
@ kElu
onert::backend::cpu::ops::ElementwiseActivationType::kLeakyReLU
@ kLeakyReLU
onert::backend::cpu::ops::ElementwiseActivationType::kTanh
@ kTanh
onert::backend::cpu::ops::ElementwiseActivationType::kGELU
@ kGELU
onert::backend::cpu::ops::ElementwiseActivationType::kLogistic
@ kLogistic
onert::backend::cpu::ops::ElementwiseActivationType::kReLU
@ kReLU
runtime
onert
backend
cpu
ops
ElementwiseActivationLayer.h
Generated by
1.9.8