pytorch/test/cpp/api
Pavel Belevich 192ca9730f C++ API parity: Hardtanh
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/27038

Test Plan: Imported from OSS

Differential Revision: D17682405

Pulled By: pbelevich

fbshipit-source-id: f65e76696e0041c3518f56da94f2e3b800305234
2019-10-04 12:53:33 -07:00
..
any.cpp Separate libtorch tests from libtorch build. (#26927) 2019-10-02 08:04:52 -07:00
autograd.cpp
CMakeLists.txt
dataloader.cpp
expanding-array.cpp
functional.cpp C++ API parity: Hardtanh 2019-10-04 12:53:33 -07:00
init.cpp Add temporary torch::k{name} enum declarations (#27051) 2019-09-30 13:38:29 -07:00
init_baseline.h
init_baseline.py
integration.cpp
jit.cpp
memory.cpp
misc.cpp C++ API parity: at::Tensor::grad 2019-09-18 09:20:38 -07:00
module.cpp
modulelist.cpp
modules.cpp C++ API parity: Hardtanh 2019-10-04 12:53:33 -07:00
optim.cpp
optim_baseline.h
optim_baseline.py
ordered_dict.cpp
parallel.cpp C++ API parity: at::Tensor::grad 2019-09-18 09:20:38 -07:00
README.md
rnn.cpp Make options.name_ private, and change all callsites to use options.name() (#26419) 2019-09-19 14:48:22 -07:00
sequential.cpp
serialize.cpp Include iteration_ in SGD optimizer serialization (#26906) 2019-09-27 09:37:20 -07:00
static.cpp
support.h
tensor.cpp C++ API parity: TensorTest.BackwardNonScalarOutputs 2019-10-03 15:36:35 -07:00
tensor_cuda.cpp
tensor_options.cpp
tensor_options_cuda.cpp
torch_include.cpp

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.