Caffe2 - C++ API
A deep learning, cross platform ML framework
stop_gradient.cc
1 
17 #include "caffe2/operators/stop_gradient.h"
18 
19 namespace caffe2 {
20 REGISTER_CPU_OPERATOR(StopGradient, StopGradientOp<CPUContext>);
21 
22 // TODO(jiayq): Add example to the doc string.
23 OPERATOR_SCHEMA(StopGradient)
24  .NumInputs(1, 1)
25  .NumOutputs(1, 1)
26  .AllowInplace({{0, 0}})
27  .IdenticalTypeAndShape()
28  .SetDoc(R"DOC(
29 StopGradient is a helper operator that does no actual numerical computation,
30 and in the gradient computation phase stops the gradient from being computed
31 through it.
32 )DOC");
33 
34 NO_GRADIENT(StopGradient);
35 } // namespace caffe2
Copyright (c) 2016-present, Facebook, Inc.