Caffe2 - C++ API
A deep learning, cross platform ML framework
Related Pages
Modules
Data Structures
Files
C++ API
Python API
GitHub
File List
Globals
caffe2
operators
swish_op.h
1
#pragma once
2
3
#include "caffe2/core/operator.h"
4
#include "caffe2/utils/math.h"
5
6
namespace
caffe2
{
7
template
<
class
Context>
8
class
SwishGradientOp
final :
public
Operator
<Context> {
9
public
:
10
USE_SIMPLE_CTOR_DTOR(
SwishGradientOp
)
11
USE_OPERATOR_CONTEXT_FUNCTIONS;
12
13
template
<
typename
T>
14
bool
DoRunWithType();
15
16
bool
RunOnDevice()
override
{
17
return
DispatchHelper<TensorTypes<float, double>
>::call(
this
, Input(X));
18
}
19
20
protected
:
21
INPUT_TAGS(X, Y, DY);
22
OUTPUT_TAGS(DX);
23
};
24
25
class
GetSwishGradient
:
public
GradientMakerBase
{
26
using
GradientMakerBase::GradientMakerBase;
27
vector<OperatorDef> GetGradientDefs()
override
{
28
return
SingleGradientDef(
29
"SwishGradient"
,
30
""
,
31
vector<string>{I(0), O(0), GO(0)},
32
vector<string>{GI(0)});
33
}
34
};
35
36
}
// namespace caffe2
caffe2::GradientMakerBase
Definition:
operator_gradient.h:47
caffe2::SwishGradientOp
Definition:
swish_op.h:8
caffe2::GetSwishGradient
Definition:
swish_op.h:25
caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition:
convert_encoded_to_raw_leveldb.cc:47
caffe2::DispatchHelper
Definition:
operator.h:560
caffe2::Operator
Definition:
operator.h:325
Generated on Thu Apr 19 2018 13:03:56 for Caffe2 - C++ API by
1.8.11