Generalize the broadcasting interface for generating constraints and add constraints for the expand operation (#81175)
Expand involves broadcasting, but we also know the output is constrained by the size given in the expand expression. So we generate similar constraints to addition but we constrain the output to the required size.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81175
Approved by: https://github.com/jamesr66a