Change the indent for float16

This commit is contained in:
HuangBingjian 2020-07-29 18:00:17 +08:00
parent 1b69923472
commit 189ccb86ab
1 changed files with 7 additions and 2 deletions

View File

@ -205,8 +205,13 @@ class TensorDataImpl : public TensorData {
if (isScalar) {
ss << value;
} else {
ss << std::setw(15) << std::setprecision(8) << std::setiosflags(std::ios::scientific | std::ios::right)
<< value;
if (std::is_same<T, float16>::value) {
ss << std::setw(11) << std::setprecision(4) << std::setiosflags(std::ios::scientific | std::ios::right)
<< value;
} else {
ss << std::setw(15) << std::setprecision(8) << std::setiosflags(std::ios::scientific | std::ios::right)
<< value;
}
}
linefeedThreshold = kThreshold1DFloat;
} else if (type == kNumberTypeBool) {