From c91a0e9ca51e3916bdbac6d808b129ddde8df6be Mon Sep 17 00:00:00 2001 From: huangbingjian Date: Wed, 21 Apr 2021 19:18:04 +0800 Subject: [PATCH] fix tensor print --- mindspore/core/ir/tensor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindspore/core/ir/tensor.cc b/mindspore/core/ir/tensor.cc index 2a18854d253..1630620ea59 100644 --- a/mindspore/core/ir/tensor.cc +++ b/mindspore/core/ir/tensor.cc @@ -367,7 +367,7 @@ class TensorDataImpl : public TensorData { if (num > kThreshold / 2) { ssize_t iter_times = std::min(static_cast(num - kThreshold / 2), static_cast(kThreshold / 2)); for (ssize_t i = 0; i < iter_times; i++) { - if (use_comma && i != 0) { + if (use_comma && (i != 0 || num <= kThreshold)) { // Not just after ignored part || Not handle ignored part ss << ','; } ss << '\n';