mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
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
7 lines
198 B
C++
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
|