MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / CompareShape

Function CompareShape

test/cpp/inference/api/tester_helper.h:1088–1103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1086}
1087
1088static bool CompareShape(const std::vector<int64_t> &a,
1089 const std::vector<int64_t> &b) {
1090 if (a.size() != b.size()) {
1091 LOG(ERROR) << string::Sprintf(
1092 "shape size not match %d != %d", a.size(), b.size());
1093 return false;
1094 }
1095 for (size_t i = 0; i < a.size(); i++) {
1096 if (a[i] != b[i]) {
1097 LOG(ERROR) << string::Sprintf(
1098 "shape %d-th element not match %d != %d", i, a[i], b[i]);
1099 return false;
1100 }
1101 }
1102 return true;
1103}
1104
1105static bool CompareTensorData(const phi::DenseTensor &a,
1106 const phi::DenseTensor &b) {

Callers 1

CompareTensorFunction · 0.85

Calls 2

SprintfFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected