MCPcopy Create free account
hub / github.com/BVLC/caffe / BasePrefetchingDataLayer

Class BasePrefetchingDataLayer

include/caffe/layers/base_data_layer.hpp:53–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51
52template <typename Dtype>
53class BasePrefetchingDataLayer :
54 public BaseDataLayer<Dtype>, public InternalThread {
55 public:
56 explicit BasePrefetchingDataLayer(const LayerParameter& param);
57 // LayerSetUp: implements common data layer setup functionality, and calls
58 // DataLayerSetUp to do special data layer setup for individual layer types.
59 // This method may not be overridden.
60 void LayerSetUp(const vector<Blob<Dtype>*>& bottom,
61 const vector<Blob<Dtype>*>& top);
62
63 virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom,
64 const vector<Blob<Dtype>*>& top);
65 virtual void Forward_gpu(const vector<Blob<Dtype>*>& bottom,
66 const vector<Blob<Dtype>*>& top);
67
68 protected:
69 virtual void InternalThreadEntry();
70 virtual void load_batch(Batch<Dtype>* batch) = 0;
71
72 vector<shared_ptr<Batch<Dtype> > > prefetch_;
73 BlockingQueue<Batch<Dtype>*> prefetch_free_;
74 BlockingQueue<Batch<Dtype>*> prefetch_full_;
75 Batch<Dtype>* prefetch_current_;
76
77 Blob<Dtype> transformed_data_;
78};
79
80} // namespace caffe
81

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected