Caffe2 - C++ API
A deep learning, cross platform ML framework
print_core_object_sizes.cc
1 
17 #include <iostream>
18 
19 #include "caffe2/core/init.h"
20 #include "caffe2/core/operator.h"
21 #include "caffe2/core/context.h"
22 #include "caffe2/core/context_gpu.h"
23 #include "caffe2/proto/caffe2.pb.h"
24 
25 #define PRINT_SIZE(cls) \
26  std::cout << "Size of " #cls ": " << sizeof(cls) << " bytes." \
27  << std::endl;
28 
29 int main(int /* unused */, char** /* unused */) {
30  PRINT_SIZE(caffe2::Blob);
33  PRINT_SIZE(caffe2::CPUContext);
34  PRINT_SIZE(caffe2::CUDAContext);
35  PRINT_SIZE(caffe2::OperatorBase);
36  PRINT_SIZE(caffe2::OperatorDef);
39  PRINT_SIZE(caffe2::TypeMeta);
40  PRINT_SIZE(caffe2::Workspace);
41  return 0;
42 }
Blob is a general container that hosts a typed pointer.
Definition: blob.h:25
The CPU Context, representing the bare minimum of what a Context class in Caffe2 should implement...
Definition: context.h:66
Workspace is a class that holds all the related objects created during runtime: (1) all blobs...
Definition: workspace.h:47
TypeMeta is a thin class that allows us to store the type of a container such as a blob...
Definition: typeid.h:88