Crate caffe2_predictor
source ·Modules
Structs
- | A thread safe vector of all ThreadLocalHelper, | this will be used to encapuslate the | locking in the APIs for the changes to | the global AllThreadLocalHelperVector instance. |
- | benchmark runner takes an @emulator | to run nets. | | The runtime will be measured by @profiler. | | The output will be formatted by @formatter |
- | @init_net: a reader net to generate | parameters | | @data_net: a reader net to generate | inputs |
- | @run_net: the predict net with parameter | and input names | | @input_dims: the input dimensions | of all operator inputs of run_net | | @input_types: the input types of all | operator inputs of run_net |
- | This struct stores information about | the inference graph which defines underlying | math of BlackBoxPredictor. Other parts of | it such as various threading optimizations | don’t belong here. |
- | Stores parameters nessasary for creating | a PredictorInterface object. |
- | A simple net supplier that always return | the same net and filler pair. | | The SingleLoadedNetSupplier contains | a shared ptr to a workspace with parameters | already loaded by net loader. |
- | A simple net supplier that always return | the same net and filler pair. |
- | Print the output of the emulator run | to stdout. |
- | ThreadLocalHelper is per thread |
- | ThreadLocalPtrImpl is per object |
Constants
Traits
- | A net emulator. In short, it can run nets | with given @iterations. |
- | A filler to initialize the parameters | and inputs of a predictor |
- | An interface to supplier a pair of net | and its filler. | | The net should be able to run once the | filler fills the workspace. | | The supplier should take the ownership | of both net and filler. |
- | An interface that formats the output | of the emulator runs. |
- | An interface to profile the metrics | of a @runnable. | | It should return execution walltime | in milliseconds. |
Functions
- Convenient helpers to fill data to workspace.
- meyer’s singleton
- | Conceptually it’s a pretty easy process | and consists of 3 steps: | | -1) SSA rewrite; | | -2) propagate inputs forwards; | | -3) propagate outputs backwards and | then forwards again. | | However, because of model outputs which | can’t be overwritten during the SSA | process, and the fact that inputs could | be overwritten by ops and also appear | in outputs, it adds a lot of extra complexity | to handle these special cases. | | A lot of this extra complexity is handled | in | | FoundOpCandidate. |
- | Extract the MetaNetDef from
db
, and | run the global init net on themaster
| workspace. |
Type Definitions
- | Parameters for a Predictor provided | by name. | | They are stored as shared_ptr to accommodate | parameter sharing |
- | Map of object pointer to instance in | each thread to achieve per thread(using | thread_local) per object(using the | map) thread local pointer |