Files
pytorch/torch/csrc/deploy/test_deploy_missing_interpreter.cpp
Sahan Chanuka Paliskara 06605c6772 [torch::deploy] Remove c10::errors from torch::deploy (#74283)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74283

Remove `c10::errors` from torch::deploy and replace them with `multipy::errors` which is effectively a wrapper around `std::runtime_error.

Review History can be found with https://github.com/pytorch/pytorch/pull/73456

Test Plan: buck test //caffe2/torch/csrc/deploy:test_deploy

Reviewed By: aivanou

Differential Revision: D34905174

fbshipit-source-id: 8883fc77dce66c489fa3fa9d14a71d1de1e0cc5f
(cherry picked from commit 7fffcdf93648e8141159fe7b1669644db4281bf4)
2022-03-16 23:51:27 +00:00

15 lines
399 B
C++

#include <gtest/gtest.h>
#include <torch/csrc/deploy/deploy.h>
#include <torch/torch.h>
int main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv);
int rc = RUN_ALL_TESTS();
return rc;
}
TEST(TorchDeployMissingInterpreter, Throws) {
// NOLINTNEXTLINE(hicpp-avoid-goto,cppcoreguidelines-avoid-goto)
EXPECT_THROW(torch::deploy::InterpreterManager(1), std::runtime_error);
}