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,
true
/*async*/
);
18
}
19
return
true
;
20
}
21
};
22
23
}
// namespace caffe2
24
25
#endif // CAFFE2_OPERATORS_STOP_GRADIENT_H_
caffe2::Operator::Input
const Tensor & Input(int idx, DeviceType type=Context::GetDeviceType())
Retrieve a non-owning reference to the input at position 'idx' for this operator. ...
Definition:
operator.h:702
caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition:
blob.h:13
caffe2::StopGradientOp
Definition:
stop_gradient.h:9
caffe2::Operator
Definition:
operator.h:677
Generated on Thu Mar 21 2019 13:06:18 for Caffe2 - C++ API by
1.8.11