| 1086 | } |
| 1087 | |
| 1088 | static 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 | |
| 1105 | static bool CompareTensorData(const phi::DenseTensor &a, |
| 1106 | const phi::DenseTensor &b) { |
no test coverage detected