pytorch/test/cpp/api
Brian Hirsh 439930c81b adding a beta parameter to the smooth_l1 loss fn (#44433)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/44433

Not entirely sure why, but changing the type of beta from `float` to `double in autocast_mode.cpp and FunctionsManual.h fixes my compiler errors, failing instead at link time

fixing some type errors, updated fn signature in a few more files

removing my usage of Scalar, making beta a double everywhere instead

Test Plan: Imported from OSS

Reviewed By: mrshenli

Differential Revision: D23636720

Pulled By: bdhirsh

fbshipit-source-id: caea2a1f8dd72b3b5fd1d72dd886b2fcd690af6d
2020-09-25 16:36:28 -07:00
..
any.cpp
autograd.cpp Don't materialize output grads (#41821) 2020-08-11 04:27:07 -07:00
CMakeLists.txt C++ API TransformerEncoderLayer (#42633) 2020-08-07 11:49:42 -07:00
dataloader.cpp
dispatch.cpp
enum.cpp
expanding-array.cpp
fft.cpp Add one dimensional FFTs to torch.fft namespace (#43011) 2020-09-19 23:32:22 -07:00
functional.cpp adding a beta parameter to the smooth_l1 loss fn (#44433) 2020-09-25 16:36:28 -07:00
init.cpp
init_baseline.h
init_baseline.py
integration.cpp
jit.cpp
memory.cpp
misc.cpp Throw error if torch.set_deterministic(True) is called with nondeterministic CuBLAS config (#41377) 2020-08-05 12:42:24 -07:00
module.cpp
modulelist.cpp
modules.cpp Implemented torch::nn::Unflatten in libtorch (#42613) 2020-08-14 15:32:13 -07:00
namespace.cpp
nn_utils.cpp [WIP] Fix cpp grad accessor API (#40887) 2020-07-16 09:11:12 -07:00
operations.cpp [Codemod][GleanFbcode] Remove dead includes in caffe2/test (#43953) 2020-09-01 21:48:28 -07:00
optim.cpp [WIP] Fix cpp grad accessor API (#40887) 2020-07-16 09:11:12 -07:00
optim_baseline.h
optim_baseline.py
ordered_dict.cpp
parallel.cpp
parallel_benchmark.cpp
parameterdict.cpp
parameterlist.cpp Impl for ParameterList (#41259) 2020-07-12 20:50:31 -07:00
README.md
rnn.cpp
sequential.cpp
serialize.cpp
static.cpp
support.cpp
support.h
tensor.cpp
tensor_cuda.cpp
tensor_indexing.cpp
tensor_options.cpp
tensor_options_cuda.cpp
torch_include.cpp
transformer.cpp C++ APIs Transformer NN Module Top Layer (#44333) 2020-09-11 08:25:27 -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.