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

Method AppendBottom

src/caffe/net.cpp:396–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394// Helper for Net::Init: add a new bottom blob to the net.
395template <typename Dtype>
396int Net<Dtype>::AppendBottom(const NetParameter& param, const int layer_id,
397 const int bottom_id, set<string>* available_blobs,
398 map<string, int>* blob_name_to_idx) {
399 const LayerParameter& layer_param = param.layer(layer_id);
400 const string& blob_name = layer_param.bottom(bottom_id);
401 if (available_blobs->find(blob_name) == available_blobs->end()) {
402 LOG(FATAL) << "Unknown bottom blob '" << blob_name << "' (layer '"
403 << layer_param.name() << "', bottom index " << bottom_id << ")";
404 }
405 const int blob_id = (*blob_name_to_idx)[blob_name];
406 LOG_IF(INFO, Caffe::root_solver())
407 << layer_names_[layer_id] << " <- " << blob_name;
408 bottom_vecs_[layer_id].push_back(blobs_[blob_id].get());
409 bottom_id_vecs_[layer_id].push_back(blob_id);
410 available_blobs->erase(blob_name);
411 bool need_backward = blob_need_backward_[blob_id];
412 // Check if the backpropagation on bottom_id should be skipped
413 if (layer_param.propagate_down_size() > 0) {
414 need_backward = layer_param.propagate_down(bottom_id);
415 }
416 bottom_need_backward_[layer_id].push_back(need_backward);
417 return blob_id;
418}
419
420template <typename Dtype>
421void Net<Dtype>::AppendParam(const NetParameter& param, const int layer_id,

Callers

nothing calls this directly

Calls 2

endMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected