From 9f94ef5878126c262e0c513e4e34e113b75ac49e Mon Sep 17 00:00:00 2001 From: huanghui Date: Wed, 25 Nov 2020 09:56:04 +0800 Subject: [PATCH] remove data sync in tensor's ToString --- mindspore/core/ir/tensor.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/mindspore/core/ir/tensor.cc b/mindspore/core/ir/tensor.cc index a814ed26e2..90e718675e 100644 --- a/mindspore/core/ir/tensor.cc +++ b/mindspore/core/ir/tensor.cc @@ -542,7 +542,6 @@ std::string Tensor::ToStringInternal(int limit_size) const { std::ostringstream buf; auto dtype = Dtype(); MS_EXCEPTION_IF_NULL(dtype); - data_sync(false); buf << "Tensor(shape=" << ShapeToString(shape_) << ", dtype=" << dtype->ToString() << ", value="; if (limit_size <= 0 || DataSize() < limit_size) { // Only print data for small tensor. @@ -568,7 +567,6 @@ std::string Tensor::ToStringRepr() const { std::ostringstream buf; auto dtype = Dtype(); MS_EXCEPTION_IF_NULL(dtype); - data_sync(false); buf << "Tensor(shape=" << ShapeToString(shape_) << ", dtype=" << dtype->ToString() << ", value=" << ((data().ndim() > 1) ? '\n' : ' ') << data().ToString(data_type_, shape_, true) << ')'; return buf.str();