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

Method ClearParamDiffs

src/caffe/net.cpp:914–932  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

912
913template <typename Dtype>
914void Net<Dtype>::ClearParamDiffs() {
915 for (int i = 0; i < learnable_params_.size(); ++i) {
916 Blob<Dtype>* blob = learnable_params_[i];
917 switch (Caffe::mode()) {
918 case Caffe::CPU:
919 caffe_set(blob->count(), static_cast<Dtype>(0),
920 blob->mutable_cpu_diff());
921 break;
922 case Caffe::GPU:
923#ifndef CPU_ONLY
924 caffe_gpu_set(blob->count(), static_cast<Dtype>(0),
925 blob->mutable_gpu_diff());
926#else
927 NO_GPU;
928#endif
929 break;
930 }
931 }
932}
933
934template <typename Dtype>
935void Net<Dtype>::ShareWeights() {

Callers 1

StepMethod · 0.80

Calls 5

caffe_setFunction · 0.85
countMethod · 0.80
mutable_cpu_diffMethod · 0.80
mutable_gpu_diffMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected