diff --git a/paddle/fluid/framework/tensor_util.cc b/paddle/fluid/framework/tensor_util.cc index 7cd62e3e2a785d4c652860242ae4787a79451416..d2616da7a127da8c5e7b204c5216d31ad8933d97 100644 --- a/paddle/fluid/framework/tensor_util.cc +++ b/paddle/fluid/framework/tensor_util.cc @@ -24,6 +24,9 @@ limitations under the License. */ #include "paddle/fluid/framework/data_type.h" #include "paddle/fluid/platform/complex.h" #include "paddle/fluid/platform/profiler.h" +#ifdef PADDLE_WITH_MKLDNN +#include "dnnl_debug.h" +#endif namespace paddle { namespace framework { @@ -1177,6 +1180,11 @@ std::ostream& operator<<(std::ostream& os, const Tensor& t) { os << " - shape: [" << t.dims() << "]\n"; os << " - layout: " << DataLayoutToString(t.layout()) << "\n"; +#ifdef PADDLE_WITH_MKLDNN + os << " - format: " + << dnnl_fmt_tag2str(static_cast(t.format())) << "\n"; +#endif + Tensor tensor; tensor.Resize(t.dims()); if (platform::is_cpu_place(t.place())) {