|
|
@ -542,7 +542,6 @@ std::string Tensor::ToStringInternal(int limit_size) const {
|
|
|
|
std::ostringstream buf;
|
|
|
|
std::ostringstream buf;
|
|
|
|
auto dtype = Dtype();
|
|
|
|
auto dtype = Dtype();
|
|
|
|
MS_EXCEPTION_IF_NULL(dtype);
|
|
|
|
MS_EXCEPTION_IF_NULL(dtype);
|
|
|
|
data_sync(false);
|
|
|
|
|
|
|
|
buf << "Tensor(shape=" << ShapeToString(shape_) << ", dtype=" << dtype->ToString() << ", value=";
|
|
|
|
buf << "Tensor(shape=" << ShapeToString(shape_) << ", dtype=" << dtype->ToString() << ", value=";
|
|
|
|
if (limit_size <= 0 || DataSize() < limit_size) {
|
|
|
|
if (limit_size <= 0 || DataSize() < limit_size) {
|
|
|
|
// Only print data for small tensor.
|
|
|
|
// Only print data for small tensor.
|
|
|
@ -568,7 +567,6 @@ std::string Tensor::ToStringRepr() const {
|
|
|
|
std::ostringstream buf;
|
|
|
|
std::ostringstream buf;
|
|
|
|
auto dtype = Dtype();
|
|
|
|
auto dtype = Dtype();
|
|
|
|
MS_EXCEPTION_IF_NULL(dtype);
|
|
|
|
MS_EXCEPTION_IF_NULL(dtype);
|
|
|
|
data_sync(false);
|
|
|
|
|
|
|
|
buf << "Tensor(shape=" << ShapeToString(shape_) << ", dtype=" << dtype->ToString()
|
|
|
|
buf << "Tensor(shape=" << ShapeToString(shape_) << ", dtype=" << dtype->ToString()
|
|
|
|
<< ", value=" << ((data().ndim() > 1) ? '\n' : ' ') << data().ToString(data_type_, shape_, true) << ')';
|
|
|
|
<< ", value=" << ((data().ndim() > 1) ? '\n' : ' ') << data().ToString(data_type_, shape_, true) << ')';
|
|
|
|
return buf.str();
|
|
|
|
return buf.str();
|
|
|
|