pytorch/test/cpp/api
Mansoor e95657b87e [C++ API] AdaptiveLogSoftmaxWithLoss (#29076)
Summary:
Implemented AdaptiveLogSoftmaxWithLoss and some tests for modules. Reference https://github.com/pytorch/pytorch/issues/25883
Pull Request resolved: https://github.com/pytorch/pytorch/pull/29076

Differential Revision: D20404588

Pulled By: yf225

fbshipit-source-id: edbadf432b8173cbcc6caf83c9c03dd92dc31a37
2020-03-12 09:53:58 -07:00
..
any.cpp [C++ API] Allow skipping default arguments in module's forward method when module is used in Sequential (#33027) 2020-02-17 20:38:02 -08:00
autograd.cpp [autograd] fix allow_unused checking for C++ API (#34035) 2020-03-02 17:57:15 -08:00
CMakeLists.txt Remove using namespace torch::autograd from header files (#34423) 2020-03-09 10:31:21 -07:00
dataloader.cpp
dispatch.cpp Add the build for runtime dispatch for AVX, AVX2 instruction set (#26125) 2020-03-10 15:32:57 -07:00
enum.cpp
expanding-array.cpp
functional.cpp Fix torch::allclose to handle std::numeric_limits<T>::lowest() for integral types (#32978) 2020-02-04 19:06:52 -08:00
init.cpp Add allow_rebase_history flag and fix codegen functions for multiple views (#32790) 2020-02-11 07:16:02 -08:00
init_baseline.h
init_baseline.py
integration.cpp Normalize reward-to-go in C++ actor-critic (#33550) 2020-02-21 09:19:39 -08:00
jit.cpp
memory.cpp
misc.cpp
module.cpp Remove dead includes in caffe2/test 2020-01-21 11:30:34 -08:00
modulelist.cpp [C++ API] Fix ModuleList compile error: error: 'begin' was not declared in this scope (#34463) 2020-03-09 08:15:50 -07:00
modules.cpp [C++ API] AdaptiveLogSoftmaxWithLoss (#29076) 2020-03-12 09:53:58 -07:00
namespace.cpp Remove using namespace torch::autograd from header files (#34423) 2020-03-09 10:31:21 -07:00
nn_utils.cpp [C++ API] Add PackedSequence / pack_padded_sequence / pad_packed_sequence / pack_sequence (#33652) 2020-02-25 12:53:41 -08:00
optim.cpp Adagrad optimizer - updated step function, added param_groups, state to optimizers 2020-01-21 14:41:12 -08:00
optim_baseline.h
optim_baseline.py
ordered_dict.cpp
parallel.cpp
README.md
rnn.cpp Fix typos, via a Levenshtein-type corrector (#31523) 2020-01-17 16:03:19 -08:00
sequential.cpp C++ make torch::nn::Sequential push_back(AnyModule) methods public (#34208) 2020-03-06 05:47:14 -08:00
serialize.cpp [C++ API Parity] rmsprop optimizer update (#33450) 2020-03-10 13:30:56 -07:00
static.cpp
support.cpp
support.h C++ tensor indexing: more indexing tests (#30427) 2020-02-28 22:07:41 -08:00
tensor.cpp Bug fixes: torch::tensor(floating-point values) -> default dtype, and torch::tensor(integer values) ->at::kLong (#32367) 2020-02-01 15:00:07 -08:00
tensor_cuda.cpp Fix MagmaInitializesCorrectly_CUDA by using an invertible matrix (#32547) 2020-01-25 20:00:54 -08:00
tensor_indexing.cpp [C++ API] Remove init-list form of at::indexing::Slice (#34255) 2020-03-06 05:51:53 -08:00
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.