3 #include "observers/macros.h" 4 #include "observers/net_observer_reporter.h" 6 #include "caffe2/core/common.h" 32 static void initSampleRate(
33 int netInitSampleRate,
34 int netFollowupSampleRate,
35 int netFollowupSampleCount,
36 int operatorNetSampleRatio,
38 CAFFE_ENFORCE(netFollowupSampleRate <= netInitSampleRate);
39 CAFFE_ENFORCE(netFollowupSampleRate >= 1 || netInitSampleRate == 0);
40 netInitSampleRate_ = netInitSampleRate;
41 netFollowupSampleRate_ = netFollowupSampleRate;
42 netFollowupSampleCount_ = netFollowupSampleCount;
43 operatorNetSampleRatio_ = operatorNetSampleRatio;
44 skipIters_ = skipIters;
46 static int getNetInitSampleRate() {
47 return netInitSampleRate_;
49 static int getNetFollowupSampleRate() {
50 return netFollowupSampleRate_;
52 static int getNetFollowupSampleCount() {
53 return netFollowupSampleCount_;
55 static int getOpoeratorNetSampleRatio() {
56 return operatorNetSampleRatio_;
58 static int getSkipIters() {
61 static void setReporter(unique_ptr<NetObserverReporter> reporter) {
62 reporter_ = std::move(reporter);
65 CAFFE_ENFORCE(reporter_);
66 return reporter_.get();
68 static void setMarker(
int marker) {
71 static int getMarker() {
77 static int netInitSampleRate_;
80 static int netFollowupSampleRate_;
84 static int netFollowupSampleCount_;
88 static int operatorNetSampleRatio_;
91 static int skipIters_;
93 static unique_ptr<NetObserverReporter> reporter_;
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...