From 1685b670559c995051b16cfd71c35ea1ebb77b92 Mon Sep 17 00:00:00 2001 From: Chen Weihang Date: Fri, 22 Oct 2021 08:28:03 +0000 Subject: [PATCH] revert dtype layout change to fix error --- paddle/pten/common/data_type.h | 2 +- paddle/pten/common/layout.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/pten/common/data_type.h b/paddle/pten/common/data_type.h index 2475e4086e731..af0548cbda581 100644 --- a/paddle/pten/common/data_type.h +++ b/paddle/pten/common/data_type.h @@ -169,7 +169,7 @@ inline std::ostream& operator<<(std::ostream& os, DataType dtype) { return os; } -inline DataType& operator++(DataType dtype, int) { +inline DataType& operator++(DataType& dtype, int) { dtype = DataType(static_cast::type>(dtype) + 1); return dtype; diff --git a/paddle/pten/common/layout.h b/paddle/pten/common/layout.h index 99288bead4ced..8e14f98625051 100644 --- a/paddle/pten/common/layout.h +++ b/paddle/pten/common/layout.h @@ -52,7 +52,7 @@ inline std::ostream& operator<<(std::ostream& os, DataLayout layout) { return os; } -inline DataLayout& operator++(DataLayout layout, int) { +inline DataLayout& operator++(DataLayout& layout, int) { layout = DataLayout( static_cast::type>(layout) + 1); return layout;