MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / VerifyTestResults

Method VerifyTestResults

tensorflow/lite/experimental/ruy/test.h:2023–2076  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2021
2022template <typename LhsScalar, typename RhsScalar, typename SpecType>
2023void TestSet<LhsScalar, RhsScalar, SpecType>::VerifyTestResults() const {
2024 const int depth = lhs.matrix.layout.cols;
2025 for (int i = 0; i < results.size() - 1; i++) {
2026 if (!Agree(*results[i], *results[i + 1], depth)) {
2027 std::string paths_in_agreement;
2028 paths_in_agreement.append(PathName(*results[0]));
2029 for (int j = 1; j <= i; j++) {
2030 paths_in_agreement.append(", ");
2031 paths_in_agreement.append(PathName(*results[j]));
2032 }
2033 ErrorAnalysis error_analysis;
2034 AnalyzeTestError(*this, i + 1, &error_analysis);
2035 std::cerr << "Error: path (" << PathName(*results[i + 1])
2036 << ") disagrees with the other paths (" << paths_in_agreement
2037 << "), which agree with each other." << std::endl;
2038 std::cerr << "Shape: rows = " << rows << ", cols = " << cols
2039 << ", depth = " << depth << std::endl;
2040 std::cerr << "Stats of the good result matrix: "
2041 << StatsAsString(error_analysis.stats_good) << std::endl;
2042 std::cerr << "Stats of the bad result matrix: "
2043 << StatsAsString(error_analysis.stats_bad) << std::endl;
2044 if (error_analysis.error_rows.size() < rows) {
2045 std::cerr << "Rows containing errors: "
2046 << Join(error_analysis.error_rows) << std::endl;
2047 } else {
2048 std::cerr << "Errors found in ALL rows." << std::endl;
2049 }
2050 if (error_analysis.error_cols.size() < cols) {
2051 std::cerr << "Cols containing errors: "
2052 << Join(error_analysis.error_cols) << std::endl;
2053 } else {
2054 std::cerr << "Errors found in ALL cols." << std::endl;
2055 }
2056 std::cerr << "The first error occurs at row "
2057 << error_analysis.row_of_first_error << ", col "
2058 << error_analysis.col_of_first_error << std::endl;
2059 std::cerr << "Good value: " << error_analysis.first_error_good_value
2060 << std::endl;
2061 std::cerr << "Bad value : " << error_analysis.first_error_bad_value
2062 << std::endl;
2063 std::cerr << "Region of Good result matrix around first error:\n\n"
2064 << DumpRegion(results[0]->storage_matrix.matrix,
2065 error_analysis.row_of_first_error,
2066 error_analysis.col_of_first_error)
2067 << std::endl;
2068 std::cerr << "Region of Bad result matrix around first error:\n\n"
2069 << DumpRegion(results[i + 1]->storage_matrix.matrix,
2070 error_analysis.row_of_first_error,
2071 error_analysis.col_of_first_error)
2072 << std::endl;
2073 RUY_CHECK(false);
2074 }
2075 }
2076}
2077
2078template <typename LhsScalar, typename RhsScalar, typename SpecType>
2079void TestSet<LhsScalar, RhsScalar, SpecType>::VerifyNonTrivial() const {

Callers

nothing calls this directly

Calls 8

AgreeFunction · 0.85
PathNameFunction · 0.85
AnalyzeTestErrorFunction · 0.85
StatsAsStringFunction · 0.85
DumpRegionFunction · 0.85
JoinFunction · 0.70
sizeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected