mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-23 14:59:34 +08:00
Reland torch.ops API change machinery with the core functionality disabled (#71785)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/71785 see https://github.com/pytorch/pytorch/pull/67254 ghstack-source-id: 147648699 Test Plan: github CI Reviewed By: albanD Differential Revision: D33777229 fbshipit-source-id: 517b36be9743025eb40d708d380dae62e3663184 (cherry picked from commit a637e695694d3fd615dbe821394bfe53d41b6901)
This commit is contained in:
committed by
PyTorch MergeBot
parent
1fdbe9aa76
commit
a1383a9cfa
@ -1104,6 +1104,13 @@ std::shared_ptr<SugaredValue> toSugaredValue(
|
||||
}
|
||||
}
|
||||
|
||||
auto opoverloadpacket_type =
|
||||
py::module::import("torch").attr("_ops").attr("OpOverloadPacket");
|
||||
py::bool_ is_overloadpacket = py::isinstance(obj, opoverloadpacket_type);
|
||||
if (is_overloadpacket) {
|
||||
obj = py::getattr(obj, "op");
|
||||
}
|
||||
|
||||
bool isRpcAvailable = py::cast<bool>(
|
||||
py::module::import("torch.distributed.rpc").attr("is_available")());
|
||||
|
||||
|
Reference in New Issue
Block a user