[package] catch exceptions from calling reduce function. (#53061)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/53061
We only care about evaluating the string return version. If `reduce()`
throws an error, we should just continue on with pickling.
Test Plan: Imported from OSS
Reviewed By: Lilyjjo
Differential Revision: D26737652
Pulled By: suo
fbshipit-source-id: 0b6fbbe345ad0b6a33330b2efa39d7bab703193d