You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
num_dynamic_dims = 0
for dim in dynamic_shape:
if isinstance(dim, torch.SymInt):
num_dynamic_dims += 1
new_shape.append(0)
else:
new_shape.append(dim)
check_or_raise(
num_dynamic_dims <= 1,
"XNNPACK reshape only supports 1 dynamic dimension. This may occur when ",
)
This is not the right way to detect how many dynamic dimensions are going into the squeeze call. For one, you could potentially have a SymInt which internally contains a constant int (we try to decay this ASAP, but if you have a SymInt in hand and then later we do a replacement that refines it to an int, you are still going to have a SymInt.)
I think probably what's more right is to call free_symbols(dim). When there are no free symbols, you are convertible to int, which is what this code is trying to do right?
Versions
main
The text was updated successfully, but these errors were encountered:
🐛 Describe the bug
You have this logic:
This is not the right way to detect how many dynamic dimensions are going into the squeeze call. For one, you could potentially have a SymInt which internally contains a constant int (we try to decay this ASAP, but if you have a SymInt in hand and then later we do a replacement that refines it to an int, you are still going to have a SymInt.)
I think probably what's more right is to call
free_symbols(dim)
. When there are no free symbols, you are convertible to int, which is what this code is trying to do right?Versions
main
The text was updated successfully, but these errors were encountered: