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

Function DumpRegion

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

Source from the content-addressed store, hash-verified

2003
2004template <typename Scalar>
2005std::string DumpRegion(const Matrix<Scalar>& matrix, int center_row,
2006 int center_col) {
2007 static constexpr int kRadius = 20;
2008 int first_row = std::max(0, center_row - kRadius);
2009 int last_row = std::min(matrix.layout.rows - 1, center_row + kRadius);
2010 int first_col = std::max(0, center_col - kRadius);
2011 int last_col = std::min(matrix.layout.cols - 1, center_col + kRadius);
2012 std::ostringstream stream;
2013 for (int row = first_row; row <= last_row; row++) {
2014 for (int col = first_col; col <= last_col; col++) {
2015 stream << static_cast<double>(Element(matrix, row, col)) << " ";
2016 }
2017 stream << "\n";
2018 }
2019 return stream.str();
2020}
2021
2022template <typename LhsScalar, typename RhsScalar, typename SpecType>
2023void TestSet<LhsScalar, RhsScalar, SpecType>::VerifyTestResults() const {

Callers 1

VerifyTestResultsMethod · 0.85

Calls 3

ElementFunction · 0.70
maxFunction · 0.50
minFunction · 0.50

Tested by

no test coverage detected