From 7fa29a6be268380c39f8614390d73bfec5ae62cf Mon Sep 17 00:00:00 2001 From: Yuang Liu Date: Tue, 22 Feb 2022 11:02:05 +0800 Subject: [PATCH] [phi] add dtype fetcher for scalar (#39775) --- paddle/phi/common/scalar.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paddle/phi/common/scalar.h b/paddle/phi/common/scalar.h index 1da77a0fa1..9a5a3fbf92 100644 --- a/paddle/phi/common/scalar.h +++ b/paddle/phi/common/scalar.h @@ -191,6 +191,8 @@ class ScalarBase { } } + DataType dtype() const { return dtype_; } + private: template friend void CopyScalar(const ScalarBase& src, ScalarBase* dst); -- GitLab