[export] Minor fixes to contrain_as_size (#106737)
Fixed some minor issues with constraint APIs while I was helping enable some other model
Pull Request resolved: https://github.com/pytorch/pytorch/pull/106737
Approved by: https://github.com/tugsbayasgalan