pytorch
93d84c0f - [coreml] Use special throw macro when encountering CoreML API errors (#77429)

Commit
3 years ago
[coreml] Use special throw macro when encountering CoreML API errors (#77429) Summary: Error messages from `TORCH_CHECK` are stripped during production builds via `-DSTRIP_ERROR_MESSAGES`. This diff introduces a new macro `COREML_CHECK` which will always preserve the error message. This macro is used when encountering errors produced by CoreML API calls so that we can heve enough context to debug. Test Plan: Test in pytorch playground: ``` arc focus2 -b pp-ios -a ModelRunner -a //xplat/caffe2/c10:c10Apple -a //xplat/caffe2:torch_mobile_coreApple -a //xplat/caffe2/fb/dynamic_pytorch:dynamic_pytorch_implApple -a //xplat/caffe2:coreml_delegateApple -a ModelRunnerDevOps -a //xplat/caffe2:torch_mobile_all_opsApple -fd --force-with-wrong-xcode ``` Differential Revision: D36378286 Pull Request resolved: https://github.com/pytorch/pytorch/pull/77429 Approved by: https://github.com/kimishpatel
Author
Stephen Jia
Committer
Parents
Loading