1 #include "runcnt_observer.h" 5 RunCountOperatorObserver::RunCountOperatorObserver(
7 RunCountNetObserver* netObserver)
8 : ObserverBase<OperatorBase>(op), netObserver_(netObserver) {
9 CAFFE_ENFORCE(netObserver_,
"Observers can't operate outside of the net");
12 std::string RunCountNetObserver::debugInfo() {
16 return "This operator runs " + c10::to_string(foo) +
" times.";
18 return "This operator runs " + c10::to_string(cnt_) +
" times.";
22 void RunCountNetObserver::Start() {}
24 void RunCountNetObserver::Stop() {}
26 void RunCountOperatorObserver::Start() {
29 void RunCountOperatorObserver::Stop() {}
31 std::unique_ptr<ObserverBase<OperatorBase>> RunCountOperatorObserver::rnnCopy(
32 OperatorBase* subject,
33 int rnn_order)
const {
34 return std::unique_ptr<ObserverBase<OperatorBase>>(
35 new RunCountOperatorObserver(subject, netObserver_));
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...