4 #include <condition_variable> 9 #include "caffe2/core/blob_stats.h" 10 #include "caffe2/core/logging.h" 11 #include "caffe2/core/stats.h" 12 #include "caffe2/core/tensor.h" 13 #include "caffe2/core/workspace.h" 23 class CAFFE2_API
BlobsQueue :
public std::enable_shared_from_this<BlobsQueue> {
27 const std::string& queueName,
30 bool enforceUniqueName,
31 const std::vector<std::string>& fieldNames = {});
38 const std::vector<Blob*>& inputs,
39 float timeout_secs = 0.0f);
40 bool tryWrite(
const std::vector<Blob*>& inputs);
41 bool blockingWrite(
const std::vector<Blob*>& inputs);
43 size_t getNumBlobs()
const {
49 void doWrite(
const std::vector<Blob*>& inputs);
51 std::atomic<bool> closing_{
false};
55 std::condition_variable cv_;
58 std::vector<std::vector<Blob*>> queue_;
59 const std::string name_;
62 CAFFE_STAT_CTOR(QueueStats);
63 CAFFE_EXPORTED_STAT(queue_balance);
64 CAFFE_EXPORTED_STAT(queue_dequeued_records);
65 CAFFE_DETAILED_EXPORTED_STAT(queue_dequeued_bytes);
66 CAFFE_AVG_EXPORTED_STAT(read_time_ns);
67 CAFFE_AVG_EXPORTED_STAT(write_time_ns);
Workspace is a class that holds all the related objects created during runtime: (1) all blobs...
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...