Store non-symbolic SymInt as int in IValue (#82555)
When symbolic integers become intrusively refcounted, it is necessary
for IValue to reference count them correctly. Instead of adding another
element to the union (which is possible, but I kind of would prefer not
to do it), I am instead representing non symbolic integers as just plain
integers in the IValue, which makes sense because they're
equivalent.
The main hazard for doing this is if there is logic inspecting the types
of the IValue to determine dispatch. For single int/symint arguments,
this should be benign as we always have an eligible int overload. For
an array of ints/symints, the list unconditionally reports as a SymInt
list, so it should be OK too. Let's see!
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82555
Approved by: https://github.com/albanD