未验证 提交 fce05d7d 编写于 作者: H HongyuJia 提交者: GitHub

update pybind11, 2.4.3->2.6.0 (#50068)

上级 78ec942b
...@@ -16,7 +16,7 @@ include(ExternalProject) ...@@ -16,7 +16,7 @@ include(ExternalProject)
set(PYBIND_PREFIX_DIR ${THIRD_PARTY_PATH}/pybind) set(PYBIND_PREFIX_DIR ${THIRD_PARTY_PATH}/pybind)
set(PYBIND_REPOSITORY ${GIT_URL}/pybind/pybind11.git) 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) set(PYBIND_INCLUDE_DIR ${THIRD_PARTY_PATH}/pybind/src/extern_pybind/include)
include_directories(${PYBIND_INCLUDE_DIR}) include_directories(${PYBIND_INCLUDE_DIR})
......
...@@ -1079,7 +1079,7 @@ def monkey_patch_varbase(): ...@@ -1079,7 +1079,7 @@ def monkey_patch_varbase():
# NOTE(zhiqiu): pybind11 will set a default __str__ method of enum class. # NOTE(zhiqiu): pybind11 will set a default __str__ method of enum class.
# So, we need to overwrite it to a more readable one. # So, we need to overwrite it to a more readable one.
# See details in https://github.com/pybind/pybind11/issues/2537. # 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): def dtype_str(dtype):
if dtype in _PADDLE_DTYPE_2_NUMPY_DTYPE: if dtype in _PADDLE_DTYPE_2_NUMPY_DTYPE:
...@@ -1092,7 +1092,7 @@ def monkey_patch_varbase(): ...@@ -1092,7 +1092,7 @@ def monkey_patch_varbase():
# for example, paddle.fluid.core.VarDesc.VarType.LOD_TENSOR # for example, paddle.fluid.core.VarDesc.VarType.LOD_TENSOR
return origin(dtype) return origin(dtype)
setattr(core.VarDesc.VarType, "__repr__", dtype_str) setattr(core.VarDesc.VarType, "__str__", dtype_str)
_already_patch_repr = True _already_patch_repr = True
# patch math methods for varbase # patch math methods for varbase
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册