Skip to content

Commit

Permalink
[EASY] Do hook sizes check with SymInt (pytorch#97362)
Browse files Browse the repository at this point in the history
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 <[email protected]>
Pull Request resolved: pytorch#97362
Approved by: https://github.com/wconstab
  • Loading branch information
ezyang authored and pytorchmergebot committed Mar 22, 2023
1 parent 5425191 commit a1edf5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch/csrc/autograd/custom_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit a1edf5f

Please sign in to comment.