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
stop_gradient.h
1
#ifndef CAFFE2_OPERATORS_STOP_GRADIENT_H_
2
#define CAFFE2_OPERATORS_STOP_GRADIENT_H_
3
4
#include "caffe2/core/operator.h"
5
6
namespace
caffe2
{
7
8
template
<
class
Context>
9
class
StopGradientOp
:
public
Operator
<Context> {
10
public
:
11
USE_SIMPLE_CTOR_DTOR(
StopGradientOp
)
12
USE_OPERATOR_CONTEXT_FUNCTIONS;
13
bool
RunOnDevice()
override
{
14
const
auto
& in = Input(0);
15
auto
* out = Output(0);
16
if
(out != &in) {
17
out->CopyFrom(in, &context_);
18
}
19
return
true
;
20
}
21
};
22
23
}
// namespace caffe2
24
25
#endif // CAFFE2_OPERATORS_STOP_GRADIENT_H_
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::StopGradientOp
Definition:
stop_gradient.h:9
caffe2::Operator
Definition:
operator.h:325
Generated on Thu Apr 19 2018 13:03:56 for Caffe2 - C++ API by
1.8.11