mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
[Modes] refactor modes to only use a stack in cpp (#86458)
Refactors the mode code to only have the C++ mode stack and not the "C++ mode" like we originally had. This also simplifies the mode logic in a number of places Pull Request resolved: https://github.com/pytorch/pytorch/pull/86458 Approved by: https://github.com/zou3519
This commit is contained in:
@ -755,8 +755,7 @@ py::object _get_operation_for_overload_or_packet(
|
||||
total_arg_num,
|
||||
false /* throw_error */);
|
||||
}
|
||||
if (overloaded_args.size() > 0 ||
|
||||
at::impl::PythonTorchFunctionTLS::get_mode()) {
|
||||
if (overloaded_args.size() > 0 || at::impl::torch_function_mode_enabled()) {
|
||||
py::object ret;
|
||||
std::string ns = symbol.ns().toUnqualString();
|
||||
std::string method_name = symbol.toUnqualString();
|
||||
|
Reference in New Issue
Block a user