mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/26897 TORCH_INTERNAL_ASSERT("foo") doesn't do what you think it does :) I'll try to do a fix to catch it in the compiler, but for now - let's fix usages Found them using regex: ``` ag --cpp "TORCH_(CHECK|INTERNAL_ASSERT)\([ \n]*\"" --multiline ``` Test Plan: Imported from OSS Differential Revision: D17624299 Pulled By: dzhulgakov fbshipit-source-id: 74f05737ef598fd92b5e61541ee36de2405df23d
29 lines
751 B
C++
29 lines
751 B
C++
#include <test/cpp/jit/tests.h>
|
|
#include <c10/util/Exception.h>
|
|
|
|
namespace torch {
|
|
namespace jit {
|
|
|
|
#if defined(_WIN32)
|
|
void runJITCPPTests(bool runCuda) {
|
|
TORCH_INTERNAL_ASSERT(false, "JIT tests not yet supported on Windows");
|
|
}
|
|
#else
|
|
#define JIT_TEST(name) test##name();
|
|
TORCH_API void runJITCPPTests(bool runCuda) {
|
|
TH_FORALL_TESTS(JIT_TEST)
|
|
if (runCuda) {
|
|
TH_FORALL_TESTS_CUDA(JIT_TEST)
|
|
}
|
|
|
|
// This test is special since it requires prior setup in python.
|
|
// So it is not part of the general test list (which is shared between the gtest
|
|
// and python test runners), but is instead invoked manually by the
|
|
// torch_python_test.cpp
|
|
testEvalModeForLoadedModule();
|
|
}
|
|
#undef JIT_TEST
|
|
#endif
|
|
} // namespace jit
|
|
} // namespace torch
|