Name Date Size #Lines LOC

..--

upgrader_models/H25-Apr-2025-

CMakeLists.txtH A D25-Apr-20255.4 KiB160139

README.mdH A D25-Apr-20251,015 4534

__init__.pyH A D25-Apr-20250 10

script_module_v4.ptlH A D25-Apr-20252.5 KiB

script_module_v5.ptlH A D25-Apr-20252.3 KiB

script_module_v6.ptlH A D25-Apr-20253.6 KiB

source_range_test.cppH A D25-Apr-20251.5 KiB5237

test_add_if_then_else.cppH A D25-Apr-20251.4 KiB5444

test_alias_analysis.cppH A D25-Apr-202556.7 KiB1,7091,411

test_argument_spec.cppH A D25-Apr-20256.4 KiB202136

test_autodiff.cppH A D25-Apr-202511.6 KiB348283

test_backend.cppH A D25-Apr-202528.5 KiB862628

test_backend_compiler_lib.cppH A D25-Apr-20257.4 KiB202148

test_backend_compiler_preprocess.cppH A D25-Apr-20252.8 KiB7758

test_backend_lib.cppH A D25-Apr-20253 KiB9470

test_class_import.cppH A D25-Apr-20254.8 KiB159128

test_class_parser.cppH A D25-Apr-20251 KiB3830

test_class_type.cppH A D25-Apr-20253.3 KiB11278

test_cleanup_passes.cppH A D25-Apr-20251.4 KiB5043

test_code_template.cppH A D25-Apr-20251.2 KiB6352

test_concat_opt.cppH A D25-Apr-202530.4 KiB747532

test_constant_pooling.cppH A D25-Apr-20253.1 KiB115105

test_create_autodiff_subgraphs.cppH A D25-Apr-2025619 2619

test_cs_debug_info_serialization.cppH A D25-Apr-20254.9 KiB156141

test_custom_class.cppH A D25-Apr-20254.4 KiB151115

test_custom_class_registrations.cppH A D25-Apr-202523.3 KiB729573

test_custom_class_registrations.hH A D25-Apr-2025923 4234

test_custom_operators.cppH A D25-Apr-20258.4 KiB261203

test_dce.cppH A D25-Apr-20251.6 KiB5340

test_exception.cppH A D25-Apr-20255 KiB161127

test_file_format.cppH A D25-Apr-20253.9 KiB12571

test_flatbuffer.cppH A D25-Apr-202562.1 KiB1,9581,364

test_fuser.cppH A D25-Apr-20258.6 KiB281238

test_graph_executor.cppH A D25-Apr-20252.4 KiB7248

test_graph_iterator.cppH A D25-Apr-20255.8 KiB204181

test_inliner.cppH A D25-Apr-20251 KiB5239

test_interface.cppH A D25-Apr-20252.3 KiB8168

test_interpreter.cppH A D25-Apr-20259.8 KiB297218

test_interpreter_async.ptH A D25-Apr-20252.8 KiB

test_ir.cppH A D25-Apr-20256.4 KiB213188

test_irparser.cppH A D25-Apr-20259.9 KiB382341

test_jit_logging_levels.cppH A D25-Apr-20251.9 KiB5845

test_jit_type.cppH A D25-Apr-20252.2 KiB6554

test_lite_interpreter.cppH A D25-Apr-202570.1 KiB2,2401,600

test_lite_interpreter_direct.cppH A D25-Apr-202527.3 KiB922694

test_lite_trainer.cppH A D25-Apr-202512.3 KiB393269

test_load_upgraders.cppH A D25-Apr-20251.3 KiB4433

test_memory_dag.cppH A D25-Apr-20253.7 KiB13993

test_misc.cppH A D25-Apr-202598.6 KiB3,1532,595

test_mobile_type_parser.cppH A D25-Apr-20258.1 KiB232192

test_module_api.cppH A D25-Apr-202514.9 KiB471349

test_op_replacement.cppH A D25-Apr-20255.7 KiB146134

test_peephole_optimize.cppH A D25-Apr-20252.8 KiB120108

test_qualified_name.cppH A D25-Apr-20252.3 KiB7557

test_save_load.cppH A D25-Apr-202511.4 KiB366303

test_schema_info.cppH A D25-Apr-202517.3 KiB395363

test_schema_matching.cppH A D25-Apr-20252.3 KiB9280

test_script_profile.cppH A D25-Apr-20251.6 KiB6353

test_shape_analysis.cppH A D25-Apr-202518.9 KiB500340

test_stack_opt.cppH A D25-Apr-202510.8 KiB310211

test_subgraph_matcher.cppH A D25-Apr-202512.5 KiB570486

test_subgraph_rewriter.cppH A D25-Apr-20257.9 KiB311249

test_subgraph_utils.cppH A D25-Apr-20254.7 KiB150124

test_union.cppH A D25-Apr-20254.7 KiB15095

test_upgrader_utils.cppH A D25-Apr-20253.1 KiB10075

test_utils.cppH A D25-Apr-20259.4 KiB300243

test_utils.hH A D25-Apr-20253.5 KiB10582

tests_setup.pyH A D25-Apr-20252.5 KiB11979

torch_python_test.cppH A D25-Apr-20252.3 KiB8849

README.md

1# JIT C++ Tests
2
3## Adding a new test
4First, create a new test file. Test files should have be placed in this
5directory, with a name that starts with `test_`, like `test_foo.cpp`.
6
7In general a single test suite
8
9Add your test file to the `JIT_TEST_SRCS` list in `test/cpp/jit/CMakeLists.txt`.
10
11A test file may look like:
12```cpp
13#include <gtest/gtest.h>
14
15using namespace ::torch::jit
16
17TEST(FooTest, BarBaz) {
18   // ...
19}
20
21// Append '_CUDA' to the test case name will automatically filter it out if CUDA
22// is not compiled.
23TEST(FooTest, NeedsAGpu_CUDA) {
24   // ...
25}
26
27// Similarly, if only one GPU is detected, tests with `_MultiCUDA` at the end
28// will not be run.
29TEST(FooTest, NeedsMultipleGpus_MultiCUDA) {
30   // ...
31}
32```
33
34## Building and running the tests
35The following commands assume you are in PyTorch root.
36
37```bash
38# ... Build PyTorch from source, e.g.
39python setup.py develop
40# (re)build just the binary
41ninja -C build bin/test_jit
42# run tests
43build/bin/test_jit --gtest_filter='glob_style_filter*'
44```
45