RelaxUnspecConstraint some more (#102729)
One annoyance with mark_dynamic is if you use it on a user specified
tensor input (the idea being that you want to compile a function and
have it be polymorphic in size), you will get an error if the user
ever sends you a 0/1 size input, because of course we are probably
going to specialize it. So I relax the constraint even more: even if we
find it's constant, if the value is 0/1, that's no big deal.
There's some irritating code duplication that I don't entirely know how
to resolve.
Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/102729
Approved by: https://github.com/avikchaudhuri, https://github.com/voznesenskym