mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[BE][Ez] Update deprecated pybind11 functions (#154798)
* getType() is deprecated, replace it with new/proper static method. These are backwards compatible with old pybind11 versions we support. So break this off before we upgrade to pybind11 3.0 where these methods are dropped in #154115 Pull Request resolved: https://github.com/pytorch/pytorch/pull/154798 Approved by: https://github.com/jansel, https://github.com/cyyever
This commit is contained in:
committed by
PyTorch MergeBot
parent
bfae151269
commit
0cd18ba1ca
@ -21,7 +21,7 @@
|
||||
namespace torch::jit {
|
||||
|
||||
std::string typeString(py::handle h) {
|
||||
return py::str(h.get_type().attr("__name__"));
|
||||
return py::str(py::type::handle_of(h).attr("__name__"));
|
||||
}
|
||||
|
||||
std::optional<StrongFunctionPtr> as_function(const py::object& obj) {
|
||||
|
Reference in New Issue
Block a user