pytorch/test/cpp/api
Jeff Moe b8fc24e092 Upstream v2.1.0 2023-11-08 09:13:36 -07:00
..
CMakeLists.txt Upstream v2.1.0 2023-11-08 09:13:36 -07:00
README.md Forklet of Pytorch 2023-11-08 09:01:59 -07:00
any.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
autograd.cpp Upstream v2.1.0 2023-11-08 09:13:36 -07:00
dataloader.cpp Upstream v2.1.0 2023-11-08 09:13:36 -07:00
dispatch.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
enum.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
expanding-array.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
fft.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
functional.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
grad_mode.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
inference_mode.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
init.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
init_baseline.h Forklet of Pytorch 2023-11-08 09:01:59 -07:00
init_baseline.py Upstream v2.1.0 2023-11-08 09:13:36 -07:00
integration.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
jit.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
memory.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
meta_tensor.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
misc.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
module.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
moduledict.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
modulelist.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
modules.cpp Upstream v2.1.0 2023-11-08 09:13:36 -07:00
namespace.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
nested.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
nn_utils.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
operations.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
optim.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
optim_baseline.h Forklet of Pytorch 2023-11-08 09:01:59 -07:00
optim_baseline.py Upstream v2.1.0 2023-11-08 09:13:36 -07:00
ordered_dict.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
parallel.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
parallel_benchmark.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
parameterdict.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
parameterlist.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
rnn.cpp Upstream v2.1.0 2023-11-08 09:13:36 -07:00
sequential.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
serialize.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
special.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
static.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
support.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
support.h Upstream v2.1.0 2023-11-08 09:13:36 -07:00
tensor.cpp Upstream v2.1.0 2023-11-08 09:13:36 -07:00
tensor_cuda.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
tensor_flatten.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
tensor_indexing.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
tensor_options.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
tensor_options_cuda.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
torch_include.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
transformer.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00

README.md

C++ Frontend Tests

In this folder live the tests for PyTorch's C++ Frontend. They use the GoogleTest test framework.

CUDA Tests

To make a test runnable only on platforms with CUDA, you should suffix your test with _CUDA, e.g.

TEST(MyTestSuite, MyTestCase_CUDA) { }

To make it runnable only on platforms with at least two CUDA machines, suffix it with _MultiCUDA instead of _CUDA, e.g.

TEST(MyTestSuite, MyTestCase_MultiCUDA) { }

There is logic in main.cpp that detects the availability and number of CUDA devices and supplies the appropriate negative filters to GoogleTest.

Integration Tests

Integration tests use the MNIST dataset. You must download it by running the following command from the PyTorch root folder:

$ python tools/download_mnist.py -d test/cpp/api/mnist

The required paths will be referenced as test/cpp/api/mnist/... in the test code, so you must run the integration tests from the PyTorch root folder.