pytorch/caffe2/operators/data_couple.h
Dong Shi da3dd9af12 No Op Optimizer (#12390)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12390

Introduce a no op optimizer for when we don't want updates to happen, but don't want to affect downstream processes.

Reviewed By: mlappelbaum

Differential Revision: D10209812

fbshipit-source-id: 2af4ebc0fb42e78ea851c3a9f4860f3d224037b6
2018-10-10 18:09:46 -07:00

23 lines
464 B
C++

#ifndef CAFFE2_OPERATORS_NO_OP_OPTIMIZER_OP_H_
#define CAFFE2_OPERATORS_NO_OP_OPTIMIZER_OP_H_
#include "caffe2/core/context.h"
#include "caffe2/core/operator.h"
namespace caffe2 {
template <class Context>
class DataCoupleOp : public Operator<Context> {
public:
USE_SIMPLE_CTOR_DTOR(DataCoupleOp)
bool RunOnDevice() override {
// Actually does nothing...
return true;
}
};
} // namespace caffe2
#endif // CAFFE2_OPERATORS_NO_OP_OPTIMIZER_OP_H_