pytorch/caffe2/operators/negate_gradient_op_gpu.cc
Yan Zhu 7b047c161d NegateGradientOp and test
Summary: add NegateGradientOp: in forward pass, this op simply copies the input to output. In backward pass, it flips the sign of gradients.

Reviewed By: dragonxlwang

Differential Revision: D6314456

fbshipit-source-id: 56afd8b131eff9f7e120ab7e4e87461df49649d4
2017-11-13 18:05:14 -08:00

7 lines
198 B
C++

#include "caffe2/core/context_gpu.h"
#include "caffe2/operators/negate_gradient_op.h"
namespace caffe2 {
REGISTER_CUDA_OPERATOR(NegateGradient, NegateGradientOp<CUDAContext>)
} // namespace caffe2