mirror of
https://github.com/pytorch/pytorch.git
synced 2026-10-28 18:56:51 +08:00
## Linked issue or supporting maintainer Part of #201370 Supported by @ezyang ## BC-breaking? No ## Summary (human written only) <!-- TODO(ezyang): fill in --> ## Agent details (if applicable) > Several indexing tests about bool / mask indexing build their masks (or > 0-dim true/false indices) as uint8, which is deprecated (#201370). Switch > them to bool so they keep testing what they are about once uint8 indexing > becomes an error. Tests that are specifically about uint8 masks are left for > that change. > > Test plan: test_indexing.py. The C++ test_api and MPS edits were not run > locally. > > Authored with an AI assistant. Pull Request resolved: https://github.com/pytorch/pytorch/pull/201373 Approved by: https://github.com/Skylion007
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.