3 #include "observers/net_observer_reporter.h" 29 static void initSampleRate(
30 int netInitSampleRate,
31 int netFollowupSampleRate,
32 int netFollowupSampleCount,
33 int operatorNetSampleRatio,
35 CAFFE_ENFORCE(netFollowupSampleRate <= netInitSampleRate);
36 CAFFE_ENFORCE(netFollowupSampleRate >= 1 || netInitSampleRate == 0);
37 netInitSampleRate_ = netInitSampleRate;
38 netFollowupSampleRate_ = netFollowupSampleRate;
39 netFollowupSampleCount_ = netFollowupSampleCount;
40 operatorNetSampleRatio_ = operatorNetSampleRatio;
41 skipIters_ = skipIters;
43 static int getNetInitSampleRate() {
44 return netInitSampleRate_;
46 static int getNetFollowupSampleRate() {
47 return netFollowupSampleRate_;
49 static int getNetFollowupSampleCount() {
50 return netFollowupSampleCount_;
52 static int getOpoeratorNetSampleRatio() {
53 return operatorNetSampleRatio_;
55 static int getSkipIters() {
58 static void setReporter(unique_ptr<NetObserverReporter> reporter) {
60 CAFFE_ENFORCE(reporter_ ==
nullptr);
61 reporter_ = std::move(reporter);
64 CAFFE_ENFORCE(reporter_);
65 return reporter_.get();
67 static void setMarker(
int marker) {
70 static int getMarker() {
76 static int netInitSampleRate_;
79 static int netFollowupSampleRate_;
83 static int netFollowupSampleCount_;
87 static int operatorNetSampleRatio_;
90 static int skipIters_;
92 static unique_ptr<NetObserverReporter> reporter_;
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...