pytorch/test/cpp/api
Peter Goldsborough cfd70dc1cf
[C++ API] Back to reset() and fixed in-place cloning (#7796)
* Back to reset() and fixed in-place cloning

* Add final override to clone_
2018-05-23 22:11:32 -07:00
..
container.cpp [C++ API] Back to reset() and fixed in-place cloning (#7796) 2018-05-23 22:11:32 -07:00
integration.cpp Revert #7750 and #7762 to fix Windows CI on master (#7772) 2018-05-22 15:42:52 -07:00
main.cpp Rename autograd namespace to torch and change torch.h into python.h (#7267) 2018-05-04 08:04:57 -07:00
misc.cpp Revert #7750 and #7762 to fix Windows CI on master (#7772) 2018-05-22 15:42:52 -07:00
module.cpp [C++ API] Back to reset() and fixed in-place cloning (#7796) 2018-05-23 22:11:32 -07:00
optim.cpp Revert #7750 and #7762 to fix Windows CI on master (#7772) 2018-05-22 15:42:52 -07:00
README.md Update C++ API tests to use Catch2 (#7108) 2018-04-30 21:36:35 -04:00
rnn.cpp Revert #7750 and #7762 to fix Windows CI on master (#7772) 2018-05-22 15:42:52 -07:00
serialization.cpp Revert #7750 and #7762 to fix Windows CI on master (#7772) 2018-05-22 15:42:52 -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