require_torch_tpu - as require_torch plus requires at least 1 TPU
Let's depict the GPU requirements in the following table:
| n gpus | decorator                      |
|--------+--------------------------------|
| >= 0 | @require_torch               |
| >= 1 | @require_torch_gpu           |
| >= 2 | @require_torch_multi_gpu     |
| < 2  | @require_torch_non_multi_gpu |
| < 3  | @require_torch_up_to_2_gpus  |
For example, here is a test that must be run only when there are 2 or more GPUs available and pytorch is installed:
python no-style
@require_torch_multi_gpu
def test_example_with_multi_gpu():
If a test requires tensorflow use the require_tf decorator. For example:
python no-style
@require_tf
def test_tf_thing_with_tensorflow():
These decorators can be stacked. For example, if a test is slow and requires at least one GPU under pytorch, here is
