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

Method DataLayerSetUp

src/caffe/layers/memory_data_layer.cpp:12–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11template <typename Dtype>
12void MemoryDataLayer<Dtype>::DataLayerSetUp(const vector<Blob<Dtype>*>& bottom,
13 const vector<Blob<Dtype>*>& top) {
14 batch_size_ = this->layer_param_.memory_data_param().batch_size();
15 channels_ = this->layer_param_.memory_data_param().channels();
16 height_ = this->layer_param_.memory_data_param().height();
17 width_ = this->layer_param_.memory_data_param().width();
18 size_ = channels_ * height_ * width_;
19 CHECK_GT(batch_size_ * size_, 0) <<
20 "batch_size, channels, height, and width must be specified and"
21 " positive in memory_data_param";
22 vector<int> label_shape(1, batch_size_);
23 top[0]->Reshape(batch_size_, channels_, height_, width_);
24 top[1]->Reshape(label_shape);
25 added_data_.Reshape(batch_size_, channels_, height_, width_);
26 added_label_.Reshape(label_shape);
27 data_ = NULL;
28 labels_ = NULL;
29 added_data_.cpu_data();
30 added_label_.cpu_data();
31}
32
33template <typename Dtype>
34void MemoryDataLayer<Dtype>::AddDatumVector(const vector<Datum>& datum_vector) {

Callers

nothing calls this directly

Calls 6

batch_sizeMethod · 0.80
channelsMethod · 0.45
heightMethod · 0.45
widthMethod · 0.45
ReshapeMethod · 0.45
cpu_dataMethod · 0.45

Tested by

no test coverage detected