"git@developer.sourcefind.cn:modelzoo/resnet50_tensorflow.git" did not exist on "cc12b7acd48776ea2f183b6379fdc275228d94d2"
Commit f56cef53 authored by Po-Yen, Chen's avatar Po-Yen, Chen
Browse files

Use std::cerr to report error

parent 7b6fb72b
...@@ -33,7 +33,7 @@ check_err(const std::vector<T>& out, ...@@ -33,7 +33,7 @@ check_err(const std::vector<T>& out,
{ {
if(out.size() != ref.size()) if(out.size() != ref.size())
{ {
std::cout << msg << " out.size() != ref.size(), :" << out.size() << " != " << ref.size() std::cerr << msg << " out.size() != ref.size(), :" << out.size() << " != " << ref.size()
<< std::endl; << std::endl;
return false; return false;
} }
...@@ -51,7 +51,7 @@ check_err(const std::vector<T>& out, ...@@ -51,7 +51,7 @@ check_err(const std::vector<T>& out,
err_count++; err_count++;
if(err_count < 5) if(err_count < 5)
{ {
std::cout << msg << std::setw(12) << std::setprecision(7) << " out[" << i std::cerr << msg << std::setw(12) << std::setprecision(7) << " out[" << i
<< "] != ref[" << i << "]: " << out[i] << " != " << ref[i] << std::endl; << "] != ref[" << i << "]: " << out[i] << " != " << ref[i] << std::endl;
} }
res = false; res = false;
...@@ -59,7 +59,7 @@ check_err(const std::vector<T>& out, ...@@ -59,7 +59,7 @@ check_err(const std::vector<T>& out,
} }
if(!res) if(!res)
{ {
std::cout << std::setw(12) << std::setprecision(7) << "max err: " << max_err << std::endl; std::cerr << std::setw(12) << std::setprecision(7) << "max err: " << max_err << std::endl;
} }
return res; return res;
} }
...@@ -74,7 +74,7 @@ check_err(const std::vector<T>& out, ...@@ -74,7 +74,7 @@ check_err(const std::vector<T>& out,
{ {
if(out.size() != ref.size()) if(out.size() != ref.size())
{ {
std::cout << msg << " out.size() != ref.size(), :" << out.size() << " != " << ref.size() std::cerr << msg << " out.size() != ref.size(), :" << out.size() << " != " << ref.size()
<< std::endl; << std::endl;
return false; return false;
} }
...@@ -95,7 +95,7 @@ check_err(const std::vector<T>& out, ...@@ -95,7 +95,7 @@ check_err(const std::vector<T>& out,
err_count++; err_count++;
if(err_count < 5) if(err_count < 5)
{ {
std::cout << msg << std::setw(12) << std::setprecision(7) << " out[" << i std::cerr << msg << std::setw(12) << std::setprecision(7) << " out[" << i
<< "] != ref[" << i << "]: " << o << " != " << r << std::endl; << "] != ref[" << i << "]: " << o << " != " << r << std::endl;
} }
res = false; res = false;
...@@ -103,7 +103,7 @@ check_err(const std::vector<T>& out, ...@@ -103,7 +103,7 @@ check_err(const std::vector<T>& out,
} }
if(!res) if(!res)
{ {
std::cout << std::setw(12) << std::setprecision(7) << "max err: " << max_err << std::endl; std::cerr << std::setw(12) << std::setprecision(7) << "max err: " << max_err << std::endl;
} }
return res; return res;
} }
...@@ -118,7 +118,7 @@ check_err(span<const T> out, ...@@ -118,7 +118,7 @@ check_err(span<const T> out,
{ {
if(out.size() != ref.size()) if(out.size() != ref.size())
{ {
std::cout << msg << " out.size() != ref.size(), :" << out.size() << " != " << ref.size() std::cerr << msg << " out.size() != ref.size(), :" << out.size() << " != " << ref.size()
<< std::endl; << std::endl;
return false; return false;
} }
...@@ -138,7 +138,7 @@ check_err(span<const T> out, ...@@ -138,7 +138,7 @@ check_err(span<const T> out,
err_count++; err_count++;
if(err_count < 5) if(err_count < 5)
{ {
std::cout << msg << std::setw(12) << std::setprecision(7) << " out[" << i std::cerr << msg << std::setw(12) << std::setprecision(7) << " out[" << i
<< "] != ref[" << i << "]: " << o << " != " << r << std::endl; << "] != ref[" << i << "]: " << o << " != " << r << std::endl;
} }
res = false; res = false;
...@@ -146,7 +146,7 @@ check_err(span<const T> out, ...@@ -146,7 +146,7 @@ check_err(span<const T> out,
} }
if(!res) if(!res)
{ {
std::cout << std::setw(12) << std::setprecision(7) << "max err: " << max_err << std::endl; std::cerr << std::setw(12) << std::setprecision(7) << "max err: " << max_err << std::endl;
} }
return res; return res;
} }
...@@ -206,7 +206,7 @@ check_err(const std::vector<T>& out, ...@@ -206,7 +206,7 @@ check_err(const std::vector<T>& out,
} }
if(!res) if(!res)
{ {
std::cout << "max err: " << max_err << std::endl; std::cerr << "max err: " << max_err << std::endl;
} }
return res; return res;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment