Fix catch block to fix 'error: catching polymorphic type' (#21637)
Summary:
Fix catch block to fix 'error: catching polymorphic type `class c10::Error` by value [-Werror=catch-value=]'
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21637
Differential Revision: D15761860
Pulled By: VitalyFedyunin
fbshipit-source-id: befc18a9c217440381cdb50a1319b0b5db5710e9