1 #ifndef CAFFE_MEMORY_DATA_LAYER_HPP_ 2 #define CAFFE_MEMORY_DATA_LAYER_HPP_ 6 #include "caffe/blob.hpp" 7 #include "caffe/layer.hpp" 8 #include "caffe/proto/caffe.pb.h" 10 #include "caffe/layers/base_data_layer.hpp" 19 template <
typename Dtype>
24 virtual void DataLayerSetUp(
const vector<
Blob<Dtype>*>& bottom,
27 virtual inline const char*
type()
const {
return "MemoryData"; }
31 virtual void AddDatumVector(
const vector<Datum>& datum_vector);
33 virtual void AddMatVector(
const vector<cv::Mat>& mat_vector,
34 const vector<int>& labels);
39 void Reset(Dtype* data, Dtype* label,
int n);
40 void set_batch_size(
int new_size);
42 int batch_size() {
return batch_size_; }
43 int channels() {
return channels_; }
44 int height() {
return height_; }
45 int width() {
return width_; }
51 int batch_size_, channels_, height_, width_, size_;
63 #endif // CAFFE_MEMORY_DATA_LAYER_HPP_ virtual void Forward_cpu(const vector< Blob< Dtype > *> &bottom, const vector< Blob< Dtype > *> &top)
Using the CPU device, compute the layer output.
Definition: memory_data_layer.cpp:108
A layer factory that allows one to register layers. During runtime, registered layers can be called b...
Definition: blob.hpp:14
virtual int ExactNumBottomBlobs() const
Returns the exact number of bottom blobs required by the layer, or -1 if no exact number is required...
Definition: memory_data_layer.hpp:28
Provides base for data layers that feed blobs to the Net.
Definition: base_data_layer.hpp:21
virtual int ExactNumTopBlobs() const
Returns the exact number of top blobs required by the layer, or -1 if no exact number is required...
Definition: memory_data_layer.hpp:29
Provides data to the Net from memory.
Definition: memory_data_layer.hpp:20
virtual const char * type() const
Returns the layer type.
Definition: memory_data_layer.hpp:27
A wrapper around SyncedMemory holders serving as the basic computational unit through which Layers...
Definition: blob.hpp:24