未验证 提交 d9d45ba7 编写于 作者: J jakpiase 提交者: GitHub

Added printing tensor's format if oneDNN is used (#34021)

* added printing tensor's format

* added suggested changes
上级 a8bfcaf4
...@@ -24,6 +24,9 @@ limitations under the License. */ ...@@ -24,6 +24,9 @@ limitations under the License. */
#include "paddle/fluid/framework/data_type.h" #include "paddle/fluid/framework/data_type.h"
#include "paddle/fluid/platform/complex.h" #include "paddle/fluid/platform/complex.h"
#include "paddle/fluid/platform/profiler.h" #include "paddle/fluid/platform/profiler.h"
#ifdef PADDLE_WITH_MKLDNN
#include "dnnl_debug.h"
#endif
namespace paddle { namespace paddle {
namespace framework { namespace framework {
...@@ -1177,6 +1180,11 @@ std::ostream& operator<<(std::ostream& os, const Tensor& t) { ...@@ -1177,6 +1180,11 @@ std::ostream& operator<<(std::ostream& os, const Tensor& t) {
os << " - shape: [" << t.dims() << "]\n"; os << " - shape: [" << t.dims() << "]\n";
os << " - layout: " << DataLayoutToString(t.layout()) << "\n"; os << " - layout: " << DataLayoutToString(t.layout()) << "\n";
#ifdef PADDLE_WITH_MKLDNN
os << " - format: "
<< dnnl_fmt_tag2str(static_cast<dnnl_format_tag_t>(t.format())) << "\n";
#endif
Tensor tensor; Tensor tensor;
tensor.Resize(t.dims()); tensor.Resize(t.dims());
if (platform::is_cpu_place(t.place())) { if (platform::is_cpu_place(t.place())) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册