pytorch/test/cpp/api
Edward Yang cd4c32691d Add complex32, complex64 and complex128 dtypes (#11173)
Summary:
We don't generate a corresponding Type implementations for them,
so this doesn't do anything at the moment.

We don't plan on supporting complex32 in the near future, but
it is added to reserve the name and number in case we do at
some point in the future.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/11173

Reviewed By: SsnL

Differential Revision: D9627477

Pulled By: ezyang

fbshipit-source-id: f49a44ab1c92d8a33130c249ac7b234f210a65e6
2018-09-03 19:19:36 -07:00
..
any.cpp Make torch::Tensor -> at::Tensor (#10516) 2018-08-15 21:25:12 -07:00
cursor.cpp Add OptimizerBase::add_parameters (#9472) 2018-07-17 14:10:22 -07:00
integration.cpp Refactor Device to not depend on Backend. (#10478) 2018-08-18 17:39:14 -07:00
main.cpp Functional DataParallel (#9234) 2018-07-19 16:12:04 -07:00
misc.cpp Update include paths for ATen/core (#10130) 2018-08-03 11:57:02 -07:00
module.cpp Make torch::Tensor -> at::Tensor (#10516) 2018-08-15 21:25:12 -07:00
modules.cpp Make torch::Tensor -> at::Tensor (#10516) 2018-08-15 21:25:12 -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
optim.cpp Remove use of data() in optimizers (#10490) 2018-08-14 13:10:19 -07:00
parallel.cpp Make torch::Tensor -> at::Tensor (#10516) 2018-08-15 21:25:12 -07:00
README.md Update C++ API tests to use Catch2 (#7108) 2018-04-30 21:36:35 -04:00
rnn.cpp Use ATen implementation of RNNs (#10761) 2018-08-23 16:12:14 -07:00
sequential.cpp Make torch::Tensor -> at::Tensor (#10516) 2018-08-15 21:25:12 -07:00
serialization.cpp Add complex32, complex64 and complex128 dtypes (#11173) 2018-09-03 19:19:36 -07:00
static.cpp Make Sequential ref-counted (#9151) 2018-07-11 17:24:59 -07:00
tensor_cuda.cpp Functional DataParallel (#9234) 2018-07-19 16:12:04 -07:00
tensor_options_cuda.cpp Delete Tensor constructor from TensorOptions. (#11101) 2018-08-31 09:55:01 -07:00
tensor_options.cpp Get rid of type() method on TensorOptions; use at::getType instead (#11023) 2018-08-31 14:27:05 -07:00
tensor.cpp Remove Tensor constructor of Scalar. (#10852) 2018-08-24 16:02:05 -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