pytorch/test/cpp/api
2018-06-20 14:46:58 -07:00
..
any.cpp [C++ API] Make pImpl easy to use in modules to enable happy reference semantics (#8347) 2018-06-18 19:45:53 -07:00
cursor.cpp Create ATen tensors via TensorOptions (#7869) 2018-06-16 00:40:35 -07:00
integration.cpp Create at::from_blob (#8640) 2018-06-19 17:00:28 -07:00
main.cpp Split up detail.h (#7836) 2018-05-30 08:55:34 -07:00
misc.cpp [C++ API] Make pImpl easy to use in modules to enable happy reference semantics (#8347) 2018-06-18 19:45:53 -07:00
module.cpp [C++ API] Create fixed width dtypes in torch:: namespace (#8639) 2018-06-19 12:40:58 -07:00
modules.cpp Created Tensor::to functions (#8643) 2018-06-20 09:28:08 -07:00
optim.cpp [C++ API] Make pImpl easy to use in modules to enable happy reference semantics (#8347) 2018-06-18 19:45:53 -07:00
README.md Update C++ API tests to use Catch2 (#7108) 2018-04-30 21:36:35 -04:00
rnn.cpp [C++ API] Create fixed width dtypes in torch:: namespace (#8639) 2018-06-19 12:40:58 -07:00
sequential.cpp [C++ API] Make pImpl easy to use in modules to enable happy reference semantics (#8347) 2018-06-18 19:45:53 -07:00
serialization.cpp [C++ API] Make pImpl easy to use in modules to enable happy reference semantics (#8347) 2018-06-18 19:45:53 -07:00
static.cpp [C++ API] Make pImpl easy to use in modules to enable happy reference semantics (#8347) 2018-06-18 19:45:53 -07:00
tensor_cuda.cpp Make at::tensor faster (#8709) 2018-06-20 14:46:58 -07:00
tensor_options_cuda.cpp Create ATen tensors via TensorOptions (#7869) 2018-06-16 00:40:35 -07:00
tensor_options.cpp Created Tensor::to functions (#8643) 2018-06-20 09:28:08 -07:00
tensor.cpp Create at::tensor (#8475) 2018-06-20 11:44:21 -07:00
util.h [C++ API] Make pImpl easy to use in modules to enable happy reference semantics (#8347) 2018-06-18 19:45:53 -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