pytorch/test/cpp/api
Gregory Chanan e00fb69b25 Use CATCH prefix to avoid name conflicts with Caffe2.
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/11780

Differential Revision: D9889925

Pulled By: gchanan

fbshipit-source-id: 5eca849c36ced00b8ae7482b7945b445a3e1687e
2018-09-18 08:12:45 -07:00
..
any.cpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
catch_utils.hpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
cursor.cpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
integration.cpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
jit.cpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
main.cpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
misc.cpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
module.cpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
modules.cpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
optim.cpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
optim_baseline.h Remove use of data() in optimizers (#10490) 2018-08-14 13:10:19 -07:00
optim_baseline.py Remove use of data() in optimizers (#10490) 2018-08-14 13:10:19 -07:00
parallel.cpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
README.md Update C++ API tests to use Catch2 (#7108) 2018-04-30 21:36:35 -04:00
rnn.cpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
sequential.cpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
serialization.cpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
static.cpp Migrate test in cpp/api/ to use gtest (#11556) 2018-09-17 17:31:43 -07:00
tensor.cpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
tensor_cuda.cpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
tensor_options.cpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
tensor_options_cuda.cpp Use CATCH prefix to avoid name conflicts with Caffe2. 2018-09-18 08:12:45 -07:00
util.h Make torch::Tensor -> at::Tensor (#10516) 2018-08-15 21:25:12 -07:00

C++ API Tests

In this folder live the tests for PyTorch's C++ API (formerly known as autogradpp). They use the Catch2 test framework.

CUDA Tests

The way we handle CUDA tests is by separating them into a separate TEST_CASE (e.g. we have optim and optim_cuda test cases in optim.cpp), and giving them the [cuda] tag. Then, inside main.cpp we detect at runtime whether CUDA is available. If not, we disable these CUDA tests by appending ~[cuda] to the test specifications. The ~ disables the tag.

One annoying aspect is that Catch only allows filtering on test cases and not sections. Ideally, one could have a section like LSTM inside the RNN test case, and give this section a [cuda] tag to only run it when CUDA is available. Instead, we have to create a whole separate RNN_cuda test case and put all these CUDA sections in there.

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