avoid Formatting::print() when STRIP_ERROR_MESSAGES is set (#30451)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/30451
TORCH_CHECK takes __VA_ARGS__ so there is no need to concatenate strings
before calling it. This way it won't call Formatting::print() on the
tensor when STRIP_ERROR_MESSAGES macro is set. Formatting::print() calls
several specific tensor methods that brings in unnecessary inter-op
dependencies for static code analysis.
Test Plan: - builds
Differential Revision: D18703784
Pulled By: ljk53
fbshipit-source-id: 1c0628e3ddcb2fd42c475cb161edbef09dfe8eb5