Caffe2 - C++ API
A deep learning, cross platform ML framework
net_observer_reporter.h
1 #pragma once
2 
3 #include <map>
4 
5 #include "caffe2/core/common.h"
6 #include "caffe2/core/net.h"
7 #include "observers/macros.h"
8 
9 namespace caffe2 {
10 
12  // Analytic
13  int64_t flops = 0;
14  int64_t bytes_written = 0;
15  int64_t bytes_read = 0;
16  std::vector<TensorShape> tensor_shapes = {};
17  std::vector<Argument> args = {};
18  std::string engine = ""; // the engine used
19  std::string type = ""; // the type of the operator
20  // Measured
21  double latency = 0;
22 };
23 
24 class CAFFE2_OBSERVER_API NetObserverReporter {
25  public:
26  virtual ~NetObserverReporter() = default;
27 
28  /*
29  Report the delay metric collected by the observer.
30  The delays are saved in a map. The key is an identifier associated
31  with the reported delay. The value is the delay value in float
32  */
33  virtual void report(
34  NetBase* net,
35  std::map<std::string, PerformanceInformation>&) = 0;
36 };
37 }
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13