MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / ShapeEquals

Method ShapeEquals

rtpose_wrapper/src/caffe/blob.cpp:392–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390
391template <typename Dtype>
392bool Blob<Dtype>::ShapeEquals(const BlobProto& other) {
393 if (other.has_num() || other.has_channels() ||
394 other.has_height() || other.has_width()) {
395 // Using deprecated 4D Blob dimensions --
396 // shape is (num, channels, height, width).
397 // Note: we do not use the normal Blob::num(), Blob::channels(), etc.
398 // methods as these index from the beginning of the blob shape, where legacy
399 // parameter blobs were indexed from the end of the blob shape (e.g., bias
400 // Blob shape (1 x 1 x 1 x N), IP layer weight Blob shape (1 x 1 x M x N)).
401 return shape_.size() <= 4 &&
402 LegacyShape(-4) == other.num() &&
403 LegacyShape(-3) == other.channels() &&
404 LegacyShape(-2) == other.height() &&
405 LegacyShape(-1) == other.width();
406 }
407 vector<int> other_shape(other.shape().dim_size());
408 for (int i = 0; i < other.shape().dim_size(); ++i) {
409 other_shape[i] = other.shape().dim(i);
410 }
411 return shape_ == other_shape;
412}
413
414template <typename Dtype>
415void Blob<Dtype>::CopyFrom(const Blob& source, bool copy_diff, bool reshape) {

Callers 2

CopyTrainedLayersFromMethod · 0.80
TYPED_TESTFunction · 0.80

Calls 6

numMethod · 0.80
shapeMethod · 0.80
sizeMethod · 0.45
channelsMethod · 0.45
heightMethod · 0.45
widthMethod · 0.45

Tested by 1

TYPED_TESTFunction · 0.64