19 #include <unordered_map> 21 #include "caffe2/core/common.h" 22 #include "caffe2/core/event.h" 23 #include "caffe2/core/net.h" 24 #include "caffe2/core/observer.h" 25 #include "caffe2/core/operator.h" 26 #include "caffe2/core/timer.h" 27 #include "caffe2/observers/operator_attaching_net_observer.h" 38 class ProfileObserver;
45 float start_time_ = 0.0f;
46 float run_time_ = 0.0f;
59 net_position_ = subject->net_position();
68 net_position_ = net_position;
69 rnn_order_ = rnn_order;
72 std::unique_ptr<ObserverBase<OperatorBase>> rnnCopy(
74 int rnn_order)
const override;
78 virtual std::string getId()
const {
81 if (rnn_order_ != OperatorBase::kNoNetPositionSet) {
82 ss <<
"-" << rnn_order_;
90 int rnn_order_ = OperatorBase::kNoNetPositionSet;
93 void Start()
override;
98 ProfileOperatorObserver,
106 void Start()
override{};
107 void Stop()
override{};
110 vector<const ProfileOperatorObserver*> operator_observers_;
Use this to implement a Observer using the Observer Pattern template.
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
A simple timer object for measuring time.