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