From a1edf5f63c62d88230d1f7feb26edb059551ae71 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Wed, 22 Mar 2023 13:37:52 -0400 Subject: [PATCH] [EASY] Do hook sizes check with SymInt (#97362) I don't think this matters for any uses right now, but I found it during an audit; might as well fix it. Signed-off-by: Edward Z. Yang Pull Request resolved: https://github.com/pytorch/pytorch/pull/97362 Approved by: https://github.com/wconstab --- torch/csrc/autograd/custom_function.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torch/csrc/autograd/custom_function.cpp b/torch/csrc/autograd/custom_function.cpp index 527a87a87aa3d..e418febda0823 100644 --- a/torch/csrc/autograd/custom_function.cpp +++ b/torch/csrc/autograd/custom_function.cpp @@ -474,7 +474,7 @@ void check_variable_result( throw std::runtime_error(ss.str()); } - if (original.sizes().vec() != result.sizes().vec()) { + if (original.sym_sizes().vec() != result.sym_sizes().vec()) { std::stringstream ss; ss << "hook '" << hook_name << "' has changed the size of value"; throw std::runtime_error(ss.str());