• Home
Name Date Size #Lines LOC

..--

CMakeLists.txtD04-Jul-20253 KiB8175

README.mdD04-Jul-20251 KiB3624

any.cppD04-Jul-202513.6 KiB458387

autograd.cppD04-Jul-202551.3 KiB1,6821,367

dataloader.cppD04-Jul-202576.1 KiB2,3231,817

dispatch.cppD04-Jul-20251.8 KiB6357

enum.cppD04-Jul-20253 KiB8983

expanding-array.cppD04-Jul-20251.6 KiB6150

fft.cppD04-Jul-20254.3 KiB131102

functional.cppD04-Jul-2025117.3 KiB3,2942,883

grad_mode.cppD04-Jul-20252.4 KiB7965

inference_mode.cppD04-Jul-202521.3 KiB658518

init.cppD04-Jul-20254.2 KiB132106

init_baseline.hD04-Jul-202542.6 KiB1,6221,612

init_baseline.pyD04-Jul-20252 KiB7651

integration.cppD04-Jul-20259.4 KiB325260

ivalue.cppD04-Jul-20252.3 KiB6448

jit.cppD04-Jul-20253.8 KiB127100

memory.cppD04-Jul-2025978 3627

meta_tensor.cppD04-Jul-20251.2 KiB3626

misc.cppD04-Jul-20252.4 KiB10580

module.cppD04-Jul-202533.9 KiB1,058892

moduledict.cppD04-Jul-20259.9 KiB310262

modulelist.cppD04-Jul-20258.9 KiB309250

modules.cppD04-Jul-2025189 KiB5,5704,882

namespace.cppD04-Jul-2025695 217

nested.cppD04-Jul-2025394 1610

nested_int.cppD04-Jul-20253.2 KiB10674

nn_utils.cppD04-Jul-202532.2 KiB894746

operations.cppD04-Jul-20253 KiB9173

optim.cppD04-Jul-202518.5 KiB576453

optim_baseline.hD04-Jul-2025105.9 KiB3,0613,036

optim_baseline.pyD04-Jul-20254.5 KiB144113

ordered_dict.cppD04-Jul-20256.8 KiB235203

parallel.cppD04-Jul-20259.3 KiB295235

parallel_benchmark.cppD04-Jul-20252.1 KiB8983

parameterdict.cppD04-Jul-20255.1 KiB145131

parameterlist.cppD04-Jul-20255.7 KiB164140

rnn.cppD04-Jul-202526.7 KiB813627

sequential.cppD04-Jul-202522.7 KiB674592

serialize.cppD04-Jul-202537.1 KiB1,095868

special.cppD04-Jul-2025316 148

static.cppD04-Jul-20252.3 KiB9274

support.cppD04-Jul-2025167 106

support.hD04-Jul-20255.6 KiB197149

tensor.cppD04-Jul-202543.2 KiB1,2611,092

tensor_cuda.cppD04-Jul-20255 KiB12795

tensor_flatten.cppD04-Jul-20251.8 KiB4430

tensor_indexing.cppD04-Jul-202535 KiB1,004774

tensor_options.cppD04-Jul-20254.9 KiB162122

tensor_options_cuda.cppD04-Jul-20252.9 KiB8359

torch_include.cppD04-Jul-2025401 159

transformer.cppD04-Jul-202558.9 KiB1,5241,355

README.md

1# C++ Frontend Tests
2
3In this folder live the tests for PyTorch's C++ Frontend. They use the
4[GoogleTest](https://github.com/google/googletest) test framework.
5
6## CUDA Tests
7
8To make a test runnable only on platforms with CUDA, you should suffix your
9test with `_CUDA`, e.g.
10
11```cpp
12TEST(MyTestSuite, MyTestCase_CUDA) { }
13```
14
15To make it runnable only on platforms with at least two CUDA machines, suffix
16it with `_MultiCUDA` instead of `_CUDA`, e.g.
17
18```cpp
19TEST(MyTestSuite, MyTestCase_MultiCUDA) { }
20```
21
22There is logic in `main.cpp` that detects the availability and number of CUDA
23devices and supplies the appropriate negative filters to GoogleTest.
24
25## Integration Tests
26
27Integration tests use the MNIST dataset. You must download it by running the
28following command from the PyTorch root folder:
29
30```sh
31$ python tools/download_mnist.py -d test/cpp/api/mnist
32```
33
34The required paths will be referenced as `test/cpp/api/mnist/...` in the test
35code, so you *must* run the integration tests from the PyTorch root folder.
36