Make StarDep.index throw an error (#107092)
There was an issue where `hasattr(dep, "index")` would incorrectly be True because it was picking up `NamedTuple.index` (a method). We were also comparing that method to a `sympy.Exper` in one place.
As far as I can tell this wasn't actually causing any bugs (the comparison actually did the right thing), but still good to fix it.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/107092
Approved by: https://github.com/eellison