[inductor] Sympy compability fix (#87249)
Test Plan: github tests
Reviewed By: yf225, voznesenskym
Differential Revision: D40495411
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87249
Approved by: https://github.com/ngimel, https://github.com/voznesenskym