From fce05d7d91300179320c5242d1b92ea9de418bf2 Mon Sep 17 00:00:00 2001 From: HongyuJia Date: Tue, 31 Jan 2023 15:17:52 +0800 Subject: [PATCH] update pybind11, 2.4.3->2.6.0 (#50068) --- cmake/external/pybind11.cmake | 2 +- python/paddle/fluid/dygraph/varbase_patch_methods.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/external/pybind11.cmake b/cmake/external/pybind11.cmake index e236767cec1..49e3111bae9 100644 --- a/cmake/external/pybind11.cmake +++ b/cmake/external/pybind11.cmake @@ -16,7 +16,7 @@ include(ExternalProject) set(PYBIND_PREFIX_DIR ${THIRD_PARTY_PATH}/pybind) set(PYBIND_REPOSITORY ${GIT_URL}/pybind/pybind11.git) -set(PYBIND_TAG v2.4.3) +set(PYBIND_TAG v2.6.0) set(PYBIND_INCLUDE_DIR ${THIRD_PARTY_PATH}/pybind/src/extern_pybind/include) include_directories(${PYBIND_INCLUDE_DIR}) diff --git a/python/paddle/fluid/dygraph/varbase_patch_methods.py b/python/paddle/fluid/dygraph/varbase_patch_methods.py index 9f0d8297f34..d6d45f23146 100644 --- a/python/paddle/fluid/dygraph/varbase_patch_methods.py +++ b/python/paddle/fluid/dygraph/varbase_patch_methods.py @@ -1079,7 +1079,7 @@ def monkey_patch_varbase(): # NOTE(zhiqiu): pybind11 will set a default __str__ method of enum class. # So, we need to overwrite it to a more readable one. # See details in https://github.com/pybind/pybind11/issues/2537. - origin = getattr(core.VarDesc.VarType, "__repr__") + origin = getattr(core.VarDesc.VarType, "__str__") def dtype_str(dtype): if dtype in _PADDLE_DTYPE_2_NUMPY_DTYPE: @@ -1092,7 +1092,7 @@ def monkey_patch_varbase(): # for example, paddle.fluid.core.VarDesc.VarType.LOD_TENSOR return origin(dtype) - setattr(core.VarDesc.VarType, "__repr__", dtype_str) + setattr(core.VarDesc.VarType, "__str__", dtype_str) _already_patch_repr = True # patch math methods for varbase -- GitLab