Added possible out of shared memory error message (#25730)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/5040
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25730
Differential Revision: D17226214
Pulled By: pbelevich
fbshipit-source-id: 92278272aab74e6690f14fc9597acfd1a98854b7