Revert "Change depreacate warning on dispatch_on_subclass to warn once (#130047)"

This reverts commit 8ff243bcf1.

Reverted https://github.com/pytorch/pytorch/pull/130047 on behalf of https://github.com/clee2000 due to broke test_overrides.py::TestTorchFunctionWarning::test_warn_on_invalid_torch_function on multiple jobs 8ff243bcf1 https://github.com/pytorch/pytorch/actions/runs/9812489165/job/27097342443.  Dr CI is doing something weird about the unstable failures ([comment](https://github.com/pytorch/pytorch/pull/130047#issuecomment-2211409090))
This commit is contained in:
PyTorch MergeBot 2024-07-05 21:03:36 +00:00
parent df50452279
commit 6fc771d19b

View File

@ -291,7 +291,7 @@ static py::object dispatch_on_subclass(
PyObject_FastGetAttrString(torch_function.ptr(), "__self__")
.is(py::handle(arg)) &&
torch_function.ptr() != torch::disabled_torch_function_impl()) {
TORCH_WARN_ONCE(
TORCH_WARN(
"Defining your `",
torch_function_name_str,
"` as a plain method is deprecated ",