Two small mem_eff bug fixes (#103201)
# Summary
Upstream two small bug fixes:
* https://github.com/fairinternal/xformers/pull/679
* https://github.com/fairinternal/xformers/pull/681
Pull Request resolved: https://github.com/pytorch/pytorch/pull/103201
Approved by: https://github.com/cpuhrsch