diff --git a/mindspore/core/ir/tensor.cc b/mindspore/core/ir/tensor.cc index 7d1403b48b..e09c371f50 100644 --- a/mindspore/core/ir/tensor.cc +++ b/mindspore/core/ir/tensor.cc @@ -233,8 +233,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::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) {