pytorch/test/cpp/api
kshitij12345 a012216b96 [nn] Fold : no batch dim (#64909)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/64907
Reference: https://github.com/pytorch/pytorch/issues/60585

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

Reviewed By: cpuhrsch, heitorschueroff

Differential Revision: D30991087

Pulled By: jbschlosser

fbshipit-source-id: 91a37e0b1d51472935ff2308719dfaca931513f3
2021-09-23 08:37:32 -07:00
..
any.cpp
autograd.cpp Disable autograd fallback tests on Windows (#65147) 2021-09-17 08:32:43 -07:00
CMakeLists.txt add out variant of linear (#61801) 2021-09-07 19:58:52 -07:00
dataloader.cpp
dispatch.cpp
enum.cpp
expanding-array.cpp
fft.cpp
functional.cpp ENH Adds label_smoothing to cross entropy loss (#63122) 2021-08-29 23:33:04 -07:00
grad_mode.cpp
imethod.cpp Make name() part of IMethod interface (#63995) 2021-08-30 13:31:55 -07:00
inference_mode.cpp
init.cpp
init_baseline.h
init_baseline.py Revert D30279364: [codemod][lint][fbcode/c*] Enable BLACK by default 2021-08-12 11:45:01 -07:00
integration.cpp
jit.cpp
memory.cpp
meta_tensor.cpp
misc.cpp
module.cpp
moduledict.cpp
modulelist.cpp
modules.cpp [nn] Fold : no batch dim (#64909) 2021-09-23 08:37:32 -07:00
namespace.cpp
nn_utils.cpp
operations.cpp add out variant of linear (#61801) 2021-09-07 19:58:52 -07:00
optim.cpp
optim_baseline.h
optim_baseline.py Revert D30279364: [codemod][lint][fbcode/c*] Enable BLACK by default 2021-08-12 11:45:01 -07:00
ordered_dict.cpp
parallel.cpp
parallel_benchmark.cpp
parameterdict.cpp
parameterlist.cpp
README.md
rnn.cpp
sequential.cpp
serialize.cpp
special.cpp
static.cpp
support.cpp
support.h
tensor.cpp
tensor_cuda.cpp
tensor_flatten.cpp
tensor_indexing.cpp
tensor_options.cpp
tensor_options_cuda.cpp
torch_include.cpp
transformer.cpp Callable activation function support for Transformer modules (C++) (#62342) 2021-08-02 08:06:39 -07:00

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.