!15484 fix tensor print

From: @huangbingjian
Reviewed-by: @zh_qh,@ginfung
Signed-off-by: @zh_qh
This commit is contained in:
mindspore-ci-bot 2021-04-22 09:36:50 +08:00 committed by Gitee
commit 0b8d4348f6
1 changed files with 1 additions and 1 deletions

View File

@ -367,7 +367,7 @@ class TensorDataImpl : public TensorData {
if (num > kThreshold / 2) {
ssize_t iter_times = std::min(static_cast<ssize_t>(num - kThreshold / 2), static_cast<ssize_t>(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';